Skip to content

Commit

Permalink
fix(api-guides): skip frontmatter when escaping curly braces
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardoAnjos16 committed Nov 28, 2022
1 parent 6544bb3 commit e7cf028
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/escapeCurlyBraces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ const escapeCurlyBraces: (content: string) => string = (content) => {
let insideCodeBlock = false
let insideMagicBlock = false

if (content.startsWith('---')) {
idx += 3
while (content.substring(idx, idx + 3) !== '---') idx++
idx += 3
}

while (idx < content.length) {
if (content.charAt(idx) === '{' && !insideCodeBlock && !insideMagicBlock)
newContent += '\\{'
Expand Down

0 comments on commit e7cf028

Please sign in to comment.