Open ccpwcn opened 2 years ago
my markdown:
```java public interface List<E> extends Collection<E> { // 内容省略 }
my go code: ```golang input := []byte(article.Content) unsafe := blackfriday.Run(input, blackfriday.WithExtensions(blackfriday.CommonExtensions)) p := bluemonday.UGCPolicy() p.AllowAttrs("class").Matching(regexp.MustCompile("^language-[a-zA-Z0-9]+$")).OnElements("code") output := string(p.SanitizeBytes(unsafe))
my html text:
<code>java public interface List<E> extends Collection<E> { // 内容省略 } </code>
show in browser:
all line and breaks has been deleted, expected, it will show look like this:
public interface List<E> extends Collection<E> { // 内容省略 }
my markdown:
my html text:
show in browser:
all line and breaks has been deleted, expected, it will show look like this: