Skip to content

Commit

Permalink
Fix JSX fragments not working with the tag matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
FIameCaster committed Jan 18, 2024
1 parent 54ff612 commit a90b5c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions package/src/extensions/matchTags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ export const createTagMatcher = (editor: PrismEditor): TagMatcher => {
const offset = content[0].length
const isClosing = value[position + 1] == "/"
const tagName = value.slice(position + 1 + <any>isClosing, position + offset)
const selfClosing =
value[position + length - 2] == "/" ||
(!noVoidTags && voidTags.includes(<string>tagName))
const notSelfClosing =
!tagName ||
(value[position + length - 2] != "/" && (noVoidTags || !voidTags.includes(tagName)))

if (content[2] && noVoidTags)
matchTagsRecursive(content.slice(1, -1), language, position + offset)

if (!selfClosing) {
if (notSelfClosing) {
if (isClosing) {
for (let i = stack.length; i; ) {
if (tagName == stack[--i][1]) {
Expand All @@ -83,7 +83,7 @@ export const createTagMatcher = (editor: PrismEditor): TagMatcher => {
1 + <any>isClosing,
position + length,
tagName,
selfClosing,
!notSelfClosing,
]
}
} else {
Expand Down

0 comments on commit a90b5c2

Please sign in to comment.