Skip to content

New Lines not adding <Softbreak /> node #394

Closed Answered by abhinav
khanakia asked this question in Q&A
Discussion options

You must be logged in to vote

@khanakia Match on the *ast.Text node and check the Text.SoftLineBreak method to see if a text ends with a soft break. There's no separate soft break node in the Goldmark AST.

if t, ok := n.(*ast.Text); ok {
  if t.SoftLineBreak() {
    fmt.Println("ends with softbreak")
  }
}

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by khanakia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #393 on May 20, 2023 12:09.