Add option to specify a grammar for MarkdownDecorator (#101)

This commit is contained in:
Marco Capano 2020-04-16 18:28:37 +01:00 committed by GitHub
parent 3b546b7dd0
commit 26d4bbe7ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -13,8 +13,8 @@ public struct MarkdownDecorator {
/// Create a Markdown decorator with a given prefix to apply to all CSS
/// classes used when highlighting code blocks within a Markdown string.
public init(classPrefix: String = "") {
highlighter = SyntaxHighlighter(format: HTMLOutputFormat(classPrefix: classPrefix))
public init(classPrefix: String = "", grammar: Grammar = SwiftGrammar()) {
highlighter = SyntaxHighlighter(format: HTMLOutputFormat(classPrefix: classPrefix), grammar: grammar)
}
/// Decorate all code blocks within a given Markdown string. This API assumes