Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm newline from end of Markdown text/plain output #27128

Merged
merged 2 commits into from
May 17, 2018

Conversation

stevengj
Copy link
Member

@stevengj stevengj commented May 16, 2018

Fixes #27102.

Since I was going through Markdown/render.jl line by line, I also made a few other small cleanups, primarily replacing single-character strings with chars.

@stevengj stevengj added the docsystem The documentation building system label May 16, 2018
@stevengj stevengj requested a review from fredrikekre May 16, 2018 21:36
@@ -9,24 +9,26 @@ function term(io::IO, content::Vector, cols)
isempty(content) && return
for md in content[1:end-1]
term(io, md, cols)
println(io)
print(io, '\n', '\n')
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Why two newllines?

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Oh I see --- because each element used to end with a newline, but those are now removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.

println(io)
join(io, ["–"^ansi_length(cells[i][j]) for j = 1:length(cells[1])], " ")
Copy link
Member

Choose a reason for hiding this comment

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

Would it be worth using '-' here as you've done in other places instead of "-"?

Copy link
Member Author

@stevengj stevengj May 16, 2018

Choose a reason for hiding this comment

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

Probably. There is a lot of this idiom in the Markdown module, however, and my inclination would be to leave it to a separate PR to audit the Markdown code for unnecessary 1-character strings.

Copy link
Sponsor Member

Choose a reason for hiding this comment

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

That would be fine, but I don't think 1-character strings are really so bad.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, they are a lot cheaper than a couple of versions ago. And Markdown rendering is not generally performance-critical.

@JeffBezanson JeffBezanson merged commit c2030ed into JuliaLang:master May 17, 2018
@stevengj stevengj deleted the mdshow branch May 18, 2018 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docsystem The documentation building system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants