Skip to content

Commit

Permalink
Fix attribute parsing for non-script/style/textarea nested languages
Browse files Browse the repository at this point in the history
FIX: Fix an issue that broke attribute reading when defining a nested language
on a tag that isn't a `style`, `textearea`, or `script` tag.
  • Loading branch information
marijnh committed May 29, 2024
1 parent 037c346 commit 8625d51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function configureNesting(tags = [], attributes = []) {
if (id == Element && other.length) {
let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs
if (tagName) for (let tag of other) {
if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(n, input))))) {
if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(open, input))))) {
let close = n.lastChild
let to = close.type.id == CloseTag ? close.from : n.to
if (to > open.to)
Expand Down

0 comments on commit 8625d51

Please sign in to comment.