-
-
Notifications
You must be signed in to change notification settings - Fork 7.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: Fix bullet list indentation bug #11830
Conversation
Hello @zulip/server-markdown members, this pull request was labeled with the "area: markdown" label, so you may want to check it out! |
@AsociTon I'm skeptical that this won't create other bugs, but am not an expert in the marked.js implementation. @aero31aero @tommyip FYI in case you have ideas for a better solution. |
I would like to see some test cases along with this. Off the top of my head, I don't think we need the The following test case, for example, would still be different on the frontend and backend because the frontend treats anything beyond
|
I will add some test cases. I checked by removing |
076d960
to
e298348
Compare
e298348
to
f70f63a
Compare
I don't know how I missed it at that time, but just repositioning the replace statement was enough to remove the above raised bug, finally did it : ) , and all the test cases pass it too.FYI @timabbott |
Included a frontend test for the odd number of spaces mixed with even spaces for the marked.js implementation, One more case that would be great to add once #11860 is resolved would be to create a miscellaneous test case comprising of +,-,* along with odd and even spacing and that would actually cover almost everything for lists in case of frontend. |
208e7e8
to
dedf269
Compare
ready for a review : ) |
dedf269
to
a933766
Compare
Previously, the frontend-only javascript processor didn't show the same output as the backend for unordered lists in case of odd indentation before the bullet indicator, resulting in wrong output shown in drafts. This is because their was no specific way to handle odd indentation. Fix for it was to check for odd indentation whenever bullet list is encountered and trim a space to make it even and ideal for zulip's markdown. Fixes zulip#10966
a933766
to
b1344c5
Compare
This makes the spacing in case of bullet-list-indentation more obvious.
b1344c5
to
147ab48
Compare
@aero31aero can you give this another review? |
Tested manually, this looks good to me.
…On Mon, Apr 22, 2019, 5:39 AM Tim Abbott ***@***.***> wrote:
@aero31aero <https://github.com/aero31aero> can you give this another
review?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11830 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AB5JHVT2EVR53SVYT4XAXK3PRT64VANCNFSM4G4XDCLA>
.
|
Actually, I'm sorry I forgot to run that earlier test case with 8 levels of indents. It is still failing. How many levels of list indents do we want to support? Regardless, I would like to see that added as a test-case in |
Heads up @gaharavara, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the |
Ideally an arbitrary number of indents, unless there's some reason that's technically infeasible. You can look at babelmark for how other markdown processors handle this. |
4ec3636
to
88b200c
Compare
Closing as we're generally thinking of standardizing our markdown processor via aligning with Djot or commonmark rather than doing custom changes like this. |
Previously, the frontend-only javascript processor didn't show the same
output as the backend, resulting in wrong output shown in drafts.
Fixes #10966
Tested various changes to the list implementation in marked.js and the final working solution that I came up with was, since we follow 2 spaces for the next item in a list why not replace all the odd number of spaces to even by reducing 1 space from them, thus adding a replace statement.