Skip to content

Commit

Permalink
Fix wrong placement of comments in wikitext
Browse files Browse the repository at this point in the history
This concerns replies to comments whose indentation characters start with "#". For example: https://ru.wikipedia.org/w/index.php?diff=110538343.
  • Loading branch information
jwbth committed Nov 17, 2020
1 parent 9e7db0c commit 4e5faf0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/Comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -1790,13 +1790,13 @@ export default class Comment extends CommentSkeleton {

// "\n" is here to avoid putting the reply on a casual empty line. "\x01" is from hiding
// closed discussions.
'(?![:*#\\n\\x01])' +
`[:*#\\x01]{0,${maxIndentationCharsLength}}(?![:*#\\n\\x01])` +

// This excludes the case where "#" is starting a numbered list inside a comment
// (https://ru.wikipedia.org/w/index.php?diff=110482717).
(
maxIndentationCharsLength > 0 ?
`|[:*#\\x01]{0,${maxIndentationCharsLength}}(?![:*\\n\\x01])` :
`|[:*#\\x01]{1,${maxIndentationCharsLength}}(?![:*\\n\\x01])` :
''
) +
')'
Expand Down

0 comments on commit 4e5faf0

Please sign in to comment.