Honour org :noweb strip-export parameter when writing HTML

Signed-off-by: Donald Hunter <donald.hunter@gmail.com>
This commit is contained in:
Donald Hunter 2024-05-22 19:38:38 +01:00
parent d31a96a3c0
commit 5f599b9e66

View file

@ -152,6 +152,10 @@ func (w *HTMLWriter) WriteBlock(b Block) {
if params[":exports"] == "results" || params[":exports"] == "none" {
break
}
if params[":noweb"] == "strip-export" {
stripNoweb := regexp.MustCompile(`<<[^>]+>>`)
content = stripNoweb.ReplaceAllString(content, "")
}
lang := "text"
if len(b.Parameters) >= 1 {
lang = strings.ToLower(b.Parameters[0])