Skip to content

Commit

Permalink
markdown: Fix bullet list indentation bug.
Browse files Browse the repository at this point in the history
Previously, the frontend-only javascript processor didn't show the same
output as the backend for unordered lists, resulting in wrong output shown
in drafts.

Fixes zulip#10966
  • Loading branch information
AsociTon committed Mar 13, 2019
1 parent e859ab7 commit f70f63a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions static/third/marked/lib/marked.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ Lexer.prototype.token = function(src, top, bq) {
src = src.substring(cap[0].length);
bull = cap[2];

// Reduces the odd number of spaces
// to even.
cap[0] = cap[0].replace(/^(( )*) ?/gm, "$1");

this.tokens.push({
type: 'list_start',
ordered: bull.length > 1
Expand Down

0 comments on commit f70f63a

Please sign in to comment.