isFenceCloser reports whether a line closes a fence opened with the given token. A closer is the fence token at column 0 with only optional trailing whitespace after it.
(line, fence string)
| 183 | // token. A closer is the fence token at column 0 with only optional trailing |
| 184 | // whitespace after it. |
| 185 | func isFenceCloser(line, fence string) bool { |
| 186 | if !strings.HasPrefix(line, fence) { |
| 187 | return false |
| 188 | } |
| 189 | return strings.TrimSpace(strings.TrimPrefix(line, fence)) == "" |
| 190 | } |
| 191 | |
| 192 | // codeLanguageChip builds the themed language badge shown above a code block, |
| 193 | // indented to align with glamour's 2-column code-block margin. The bar uses |
no outgoing calls
no test coverage detected