-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Markdown display of lists is broken on nightly #38275
Labels
Milestone
Comments
#37235 might not have been enough of a fix. |
KristofferC
added
the
regression
Regression in behavior compared to a previous version
label
Nov 2, 2020
Actually, #37235 made it worse. Here's what you get if you revert that: |
Reverting that and then adding this diff: diff --git a/stdlib/Markdown/src/render/terminal/formatting.jl b/stdlib/Markdown/src/render/terminal/formatting.jl
index 5fa4eae249..4fd1cccedf 100644
--- a/stdlib/Markdown/src/render/terminal/formatting.jl
+++ b/stdlib/Markdown/src/render/terminal/formatting.jl
@@ -13,16 +13,13 @@ function wrapped_lines!(lines, io::IO, s::AbstractString, width, i)
ws = words(s)
for word in ws
word_length = ansi_length(word)
- if i + word_length + 1 > width
+ word_length == 0 && continue
+ if isempty(lines) || i + word_length + 1 > width
i = word_length
push!(lines, word)
else
i += word_length + 1
- if isempty(lines)
- push!(lines, word)
- else
- lines[end] *= " " * word # this could be more efficient
- end
+ lines[end] *= " " * word # this could be more efficient
end
end
return i Almost gets you there (off by one space): But from the screenshot above it looks like 1.5 is off by one space on the first line. |
timholy
added a commit
that referenced
this issue
Nov 19, 2020
This changes one test, but IMO the extra spaces in the test result are not actually desirable. The alignment on Julia 1.5 is also off-by-one, whereas this seems well-aligned.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like this on
nightly
and this on 1.5.0
To reproduce,
The text was updated successfully, but these errors were encountered: