Skip to content

Drop backslash escapes that Markdown does not need - #507

Open
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:tidy-markdown-escapes
Open

Drop backslash escapes that Markdown does not need#507
slachiewicz wants to merge 1 commit into
apache:masterfrom
slachiewicz:tidy-markdown-escapes

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Pages converted from APT with an older doxia-converter carry a backslash in front of
punctuation that is not markup where it stands, for example maven\-source\-plugin,
\(default\) and required\.. The backslash renders as nothing; it only makes the source
harder to read and to edit, which was the point of moving to Markdown.

Only positions where the bare character can never be markup are touched: a hyphen,
underscore or asterisk between two word characters, a parenthesis, a full stop that
does not follow a digit, and an exclamation mark not followed by [.

Left alone deliberately:

  • angle brackets, since <escapeString> really would be read as an HTML tag
  • a full stop after a digit, so an ordered list marker cannot appear by accident
  • a run of dots, because bare ... is rendered as a single ellipsis character
  • code spans, fenced blocks and link destinations

Verified by building the site before and after: every generated page is identical in
its visible text and in every link target.

Pages converted from APT with an older doxia-converter carry an escape in front of
punctuation that is not markup where it stands: a hyphen or underscore inside a word,
a parenthesis, a full stop after a letter. The backslash renders as nothing and only
makes the source harder to read and to edit.

Only positions where the bare character can never be markup are touched. A full stop
after a digit keeps its escape, so an ordered list marker cannot appear by accident,
and angle brackets keep theirs, since <escapeString> would otherwise be read as a tag.
Code spans, fenced blocks and link destinations are left alone.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant