fix(11.1-07): check go fences, README src= and shell fences from the AST
- goLang follows the highlighter's chroma lookup, so golang and main.go need src= - a src= fence in a module README is refused and never captioned - shell fences inside callouts and lists are command-checked - a fence with four or more leading spaces is an indented code block
This commit is contained in:
@@ -469,7 +469,9 @@ func scanFences(lines []string) []fence {
|
||||
|
||||
func openFence(line string) (fence, bool) {
|
||||
trimmed := strings.TrimLeft(line, " ")
|
||||
if len(trimmed) < 3 || (trimmed[0] != '`' && trimmed[0] != '~') {
|
||||
// CommonMark: a fence has at most three leading spaces. Four or more
|
||||
// is an indented code block, which is what goldmark parses.
|
||||
if len(line)-len(trimmed) > 3 || len(trimmed) < 3 || (trimmed[0] != '`' && trimmed[0] != '~') {
|
||||
return fence{}, false
|
||||
}
|
||||
c := trimmed[0]
|
||||
|
||||
Reference in New Issue
Block a user