Skip to content

Commit

Permalink
Add an exception to the a element since we use it as a block and in…
Browse files Browse the repository at this point in the history
…line | Fixes metal#371
  • Loading branch information
matuzalemsteles committed Apr 24, 2018
1 parent 5cf93bc commit 8d8b8c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/metal-incremental-dom/src/html/HTMLParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,15 @@ var HTMLParser = function(html, handler) {
tagName = tagName.toLowerCase();

if (block[tagName]) {
// Close last tag if it's inline, except if it's a "span" (since people
// Close last tag if it's inline, except if it's a "span" and "a" (since people
// usually add anything they want to spans, and browsers allow it).
// Note: this exception for "span" was added manually (i.e. it's not
// Note: this exception for "span" and "a" was added manually (i.e. it's not
// present in the original code).
while (
stack.last() &&
inline[stack.last()] &&
stack.last() !== 'span'
stack.last() !== 'span' &&
stack.last() !== 'a'
) {
parseEndTag('', stack.last());
}
Expand Down

0 comments on commit 8d8b8c4

Please sign in to comment.