Skip to content

Conversation

@rhysd
Copy link

@rhysd rhysd commented Mar 14, 2018

Marked version: 0.3.17

Markdown flavor: Markdown.pl|CommonMark|GitHub Flavored Markdown

Description

I modified a regex to match HTML tags to

^<!--[\s\S]*?-->|^<\/?[a-zA-Z0-9\-]+(?:="[^"]*"|='[^']*'|=[^<>\s]+|\s[^<=>\/\s]*)*?\/?>

For example, when matching to <a href=https://example.com>,

  • \s[^<=>\/\s]* matches to attribute name just before =: href
  • =[^<>\s]+ matches to = and attribute value without quotes: =https://example.com
  • Regex in (?:...) matches only strings starting with = or \s. So finally it breaks and matches to the last >

Contributor

  • Test(s) exist to ensure functionality and minimize regresstion (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

  • Draft GitHub release notes have been updated.
  • CI is green (no forced merge required).
  • Merge PR

@UziTech
Copy link
Member

UziTech commented Mar 14, 2018

@Feder1co5oave does #1135 address this?

@Feder1co5oave
Copy link
Contributor

Yes

@joshbruce
Copy link
Member

Closing in favor of #1135

@joshbruce joshbruce closed this Mar 22, 2018
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.

HTML Attributes without quote is broken

4 participants