Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/transformers/src/shared/notation-transformer.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ShikiTransformer, ShikiTransformerContext } from '@shikijs/core'
import type { Element, Text } from 'hast'
import type { ParsedComments } from './parse-comments'
import { parseComments, v1ClearEndCommentPrefix } from './parse-comments'
import { parseComments, v1ClearEndCommentPrefix, v3ClearEndCommentPrefix } from './parse-comments'

export type MatchAlgorithm = 'v1' | 'v3'

Expand Down Expand Up @@ -67,6 +67,8 @@ export function createCommentNotationTransformer(

if (matchAlgorithm === 'v1')
comment.info[1] = v1ClearEndCommentPrefix(comment.info[1])
else if (matchAlgorithm === 'v3')
comment.info[1] = v3ClearEndCommentPrefix(comment.info[1])

const isEmpty = comment.info[1].trim().length === 0
// ignore comment node
Expand Down
6 changes: 6 additions & 0 deletions packages/transformers/test/fixtures/diff/1007.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions packages/transformers/test/fixtures/diff/1007.yaml.output.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading