@@ -19,7 +19,7 @@ import (
19
19
// HTMLWriter exports an org document into a html document.
20
20
type HTMLWriter struct {
21
21
ExtendingWriter Writer
22
- HighlightCodeBlock func (source , lang string , inline bool ) string
22
+ HighlightCodeBlock func (source , lang string , inline bool , params map [ string ] string ) string
23
23
PrettyRelativeLinks bool
24
24
25
25
strings.Builder
@@ -66,7 +66,7 @@ func NewHTMLWriter() *HTMLWriter {
66
66
document : & Document {Configuration : defaultConfig },
67
67
log : defaultConfig .Log ,
68
68
htmlEscape : true ,
69
- HighlightCodeBlock : func (source , lang string , inline bool ) string {
69
+ HighlightCodeBlock : func (source , lang string , inline bool , params map [ string ] string ) string {
70
70
if inline {
71
71
return fmt .Sprintf ("<div class=\" highlight-inline\" >\n <pre>\n %s\n </pre>\n </div>" , html .EscapeString (source ))
72
72
}
@@ -129,7 +129,7 @@ func (w *HTMLWriter) WriteBlock(b Block) {
129
129
if len (b .Parameters ) >= 1 {
130
130
lang = strings .ToLower (b .Parameters [0 ])
131
131
}
132
- content = w .HighlightCodeBlock (content , lang , false )
132
+ content = w .HighlightCodeBlock (content , lang , false , params )
133
133
w .WriteString (fmt .Sprintf ("<div class=\" src src-%s\" >\n %s\n </div>\n " , lang , content ))
134
134
case "EXAMPLE" :
135
135
w .WriteString (`<pre class="example">` + "\n " + html .EscapeString (content ) + "\n </pre>\n " )
@@ -159,7 +159,7 @@ func (w *HTMLWriter) WriteInlineBlock(b InlineBlock) {
159
159
switch b .Name {
160
160
case "src" :
161
161
lang := strings .ToLower (b .Parameters [0 ])
162
- content = w .HighlightCodeBlock (content , lang , true )
162
+ content = w .HighlightCodeBlock (content , lang , true , nil )
163
163
w .WriteString (fmt .Sprintf ("<div class=\" src src-inline src-%s\" >\n %s\n </div>" , lang , content ))
164
164
case "export" :
165
165
if strings .ToLower (b .Parameters [0 ]) == "html" {
0 commit comments