Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions data/reports/knitr_no_scriptpad.rhtml
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,11 @@ end.rcode-->
<p>Well, everything seems to be working. Let's ask R what is the
value of &pi;? Of course it is <!--rinline pi -->.</p>

<span>Nonce check: <span id="nonce-check-result">FAIL</span></span>

<script>
document.getElementById('nonce-check-result').innerText = "SUCCESS";
</script>

</body>
</html>
6 changes: 6 additions & 0 deletions data/reports/knitr_no_scriptpad.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ library(knitr)
knit('knitr-minimal.Rmd')
```

<span>Nonce check: <span id="nonce-check-result">FAIL</span></span>

<script>
document.getElementById('nonce-check-result').innerText = "SUCCESS";
</script>

## Conclusion

Markdown is super easy to write. Go to **knitr** [homepage](http://yihui.name/knitr) for details.
15 changes: 15 additions & 0 deletions data/reports/nonce_check.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>
<title>Test script nonce in Knitr HTML</title>
</head>
<body>

<span>Nonce check: <span id="nonce-check-result">FAIL</span></span>

<script>
document.getElementById('nonce-check-result').innerText = "SUCCESS";
</script>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,11 @@ end.rcode-->
<p>Well, everything seems to be working. Let's ask R what is the
value of &pi;? Of course it is <!--rinline pi -->.</p>

<span>Nonce check: <span id="nonce-check-result">FAIL</span></span>

<script>
document.getElementById('nonce-check-result').innerText = "SUCCESS";
</script>

</body>
</html>
6 changes: 6 additions & 0 deletions modules/scriptpad/resources/reports/schemas/script_rmd.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ library(knitr)
knit('knitr-minimal.Rmd')
```

<span>Nonce check: <span id="nonce-check-result">FAIL</span></span>

<script>
document.getElementById('nonce-check-result').innerText = "SUCCESS";
</script>

## Conclusion

Markdown is super easy to write. Go to **knitr** [homepage](http://yihui.name/knitr) for details.
6 changes: 3 additions & 3 deletions src/org/labkey/test/TestFileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public static String getFileContents(Path path)
{
try
{
return new String(Files.readAllBytes(path), StandardCharsets.UTF_8);
return Files.readString(path);
}
catch (IOException fail)
{
Expand Down Expand Up @@ -306,7 +306,7 @@ public static Set<File> getSampleDataDirs()
if (sampledataDirsFile.exists())
{
String path = getFileContents(sampledataDirsFile);
_sampledataDirs.addAll(Arrays.stream(path.split(";")).map(File::new).collect(Collectors.toList()));
_sampledataDirs.addAll(Arrays.stream(path.split(";")).map(File::new).toList());
}
else
{
Expand All @@ -317,7 +317,7 @@ public static Set<File> getSampleDataDirs()
// We know where the modules live; no reason to insist that sampledata.dirs exists.
Files.walkFileTree(modulesDir, Collections.emptySet(), 2, new SimpleFileVisitor<>(){
@Override
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException
public @NotNull FileVisitResult preVisitDirectory(@NotNull Path dir, @NotNull BasicFileAttributes attrs)
{
if (dir.equals(modulesDir))
{
Expand Down
Loading