Skip to content

Commit

Permalink
Fix documentation typo
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgio committed Aug 8, 2024
1 parent 72b012f commit 3a1a411
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class BlockTokenParser(private val context: MutableContext) : BlockTokenVisitor<

/**
* Splits a heading text and its custom ID from a raw text.
* `# Heading {#custom-id}` -> `Heading`, `custom-id`
* `Heading {#custom-id}` -> `Heading`, `custom-id`
* @param text heading text
* @return a pair of the heading text and its custom ID
*/
Expand All @@ -142,7 +142,7 @@ class BlockTokenParser(private val context: MutableContext) : BlockTokenVisitor<
val depth = groups.next().length // Amount of # characters.

val rawText = groups.next().trim().takeUntilLastOccurrence(" #") // Remove trailing # characters.
// # Heading {#custom-id} -> Heading, custom-id
// Heading {#custom-id} -> Heading, custom-id
val (text, customId) = splitHeadingTextAndId(rawText)

return Heading(
Expand All @@ -156,7 +156,7 @@ class BlockTokenParser(private val context: MutableContext) : BlockTokenVisitor<
val groups = token.data.groups.iterator(consumeAmount = 2)

val rawText = groups.next().trim()
// # Heading {#custom-id} -> Heading, custom-id
// Heading {#custom-id} -> Heading, custom-id
val (text, customId) = splitHeadingTextAndId(rawText)

return Heading(
Expand Down

0 comments on commit 3a1a411

Please sign in to comment.