Skip to content

Commit

Permalink
parsing of +++ block on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart committed May 21, 2021
1 parent 25b23a2 commit b7284cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Franklin"
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
authors = ["Thibaut Lienart <[email protected]>"]
version = "0.10.36"
version = "0.10.37"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
2 changes: 1 addition & 1 deletion src/parser/markdown/tokens.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ that works will be taken.
const MD_TOKENS = LittleDict{Char, Vector{TokenFinder}}(
'<' => [ isexactly("<!--") => :COMMENT_OPEN, # <!-- ...
],
'+' => [ isexactly("+++", ('\n',)) => :MD_DEF_TOML,
'+' => [ isexactly("+++", ('\n','\r')) => :MD_DEF_TOML,
],
'-' => [ isexactly("-->") => :COMMENT_CLOSE, # ... -->
incrlook(is_hr1) => :HORIZONTAL_RULE, # ---+
Expand Down
11 changes: 11 additions & 0 deletions test/converter/md/md_defs2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,14 @@ end
""" |> fd2html
@test isapproxstr(s, "<p> 5 2013-09-04</p>")
end

# windows return
@testset "mddefwindows" begin
s = "+++\r\na = \"hello\"\r\n+++\r\n# hi\r\n{{a}}" |> fd2html
@test isapproxstr(s,
"""
<h1 id=\"hi\"><a href=\"#hi\" class=\"header-anchor\">hi</a></h1>
hello
"""
)
end

2 comments on commit b7284cb

@tlienart
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/37180

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 v0.10.37 -m "<description of version>" b7284cbee9d48f851273c46ff771274c5cc5596f
git push origin v0.10.37

Please sign in to comment.