Skip to content

Commit

Permalink
fix newline padding for pre tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Helmut Hänsel committed Apr 19, 2023
1 parent 6f0eec3 commit 3f0a640
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/StippleUIParser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ end

function parse_to_stipple(el::EzXML.Node, level = 1; indent = 4, pre = false)
if ! iselement(el)
# content = pre ? replace(replace(el.content, r"^\r?\n" => ""), r"\r?\n$" => "") : strip(el.content)
content = pre ? el.content : strip(el.content)
content == "" && return ""
quotes = occursin('"', content) ? "\"\"\"" : "\""
Expand Down Expand Up @@ -220,7 +221,10 @@ function parse_to_html(el::EzXML.Node, level = 1; indent = 4, pre = false)
("$sep1\n$indent_1", "\n$indent_2")
end
tag = el.name
lowercase(tag) == "pre" && no > 0 && (sep2 = "$sep1\n")
if lowercase(tag) == "pre"
no > 0 && (sep2 = "$sep1\n")
children_str = replace(replace(children_str, r"^\r?\n" => ""), r"\r?\n$" => "")
end
"""<$tag$sep1$attr_str>$sep2$children_str$sep3</$tag>"""
end

Expand Down

2 comments on commit 3f0a640

@hhaensel
Copy link
Member

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 updated: JuliaRegistries/General/81733

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.22.2 -m "<description of version>" 3f0a6407dc182525a658860d4caec46915a4457b
git push origin v0.22.2

Please sign in to comment.