Skip to content

Commit

Permalink
Avoid startswith(Nothing, ...) (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikhuijzer authored Feb 24, 2023
1 parent e0a2b29 commit 0984159
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PlutoStaticHTML"
uuid = "359b1769-a58e-495b-9770-312e911026ad"
authors = ["Rik Huijzer <project@huijzer.xyz>"]
version = "6.0.12"
version = "6.0.13"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
6 changes: 3 additions & 3 deletions src/html.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ end

function _output2html(cell::Cell, ::MIME"text/plain", oopts)
var = _var(cell)
body = cell.output.body
body = string(cell.output.body)::String
# `+++` means that it is a cell with Franklin definitions.
if oopts.hide_md_def_code && startswith(body, "+++")
# Go back into Markdown mode instead of HTML
Expand All @@ -137,10 +137,10 @@ function _output2html(cell::Cell, ::MIME"text/plain", oopts)
end

function _output2html(cell::Cell, ::MIME"text/html", oopts)
body = cell.output.body
body = string(cell.output.body)::String

if contains(body, """<script type="text/javascript" id="plutouiterminal">""")
return _patch_with_terminal(string(body))
return _patch_with_terminal(body)
end

# The docstring is already visible in Markdown and shouldn't be shown below the code.
Expand Down
2 changes: 1 addition & 1 deletion src/pdf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function tex_output_block(text::String)
end

function _output2tex(cell::Cell, ::MIME"text/plain", oopts::OutputOptions)
body = cell.output.body
body = string(cell.output.body)::String
# `+++` means that it is a cell with Franklin definitions.
if oopts.hide_md_def_code && startswith(body, "+++")
return ""
Expand Down

2 comments on commit 0984159

@rikhuijzer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/78406

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v6.0.13 -m "<description of version>" 0984159ca26e7e98644c9c34513b7dab32972bab
git push origin v6.0.13

Please sign in to comment.