Skip to content

Fix link and image rules failing to match due to invalid POSIX regex …#2

Open
heshammahamed wants to merge 2 commits into
mainfrom
fix/link_image_regex
Open

Fix link and image rules failing to match due to invalid POSIX regex …#2
heshammahamed wants to merge 2 commits into
mainfrom
fix/link_image_regex

Conversation

@heshammahamed

Copy link
Copy Markdown

Problem

The link [label](url) and image ![alt](url) rules in never produced
<a> or <img> tags. The regexes used \x5D (hex for ]) and
\x5B (hex for [) in character classes, which are PCRE/Perl
extensions not supported by the POSIX regcomp used in Srl.Regex.

Fix

Replace the invalid hex escapes with POSIX-compatible equivalents:

  • [^\n\x5D][^]\n] — placing ] first after [^ is the
    standard POSIX way to include a literal ] in a negated class
  • \x5B[[ needs no escaping inside a character class

@heshammahamed

Copy link
Copy Markdown
Author

Added new rules to handle the Markdown patterns mentioned in Closes #5 and Closes #6, which were discovered while rendering external libraries documentation in alusus.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant