Skip to content

Commit

Permalink
org-hugo-example-block: Remove b-o-l line nums only when enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Jan 4, 2022
1 parent ee4a895 commit fb728ea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ox-hugo.el
Original file line number Diff line number Diff line change
Expand Up @@ -1754,10 +1754,11 @@ information."
(when linenostart-str
(setq code-attr-str (format "%s, linenostart=%s" code-attr-str linenostart-str))))

;; Remove Org-inserted numbers from the beginning of each line
;; as the Hugo highlight shortcode will be used instead of
;; literally inserting the line numbers.
(setq example-code (replace-regexp-in-string "^[0-9]+\\s-\\{2\\}" "" example-code))
(when number-lines
;; Remove Org-inserted numbers from the beginning of each line
;; as the Hugo highlight shortcode will be used instead of
;; literally inserting the line numbers.
(setq example-code (replace-regexp-in-string "^[0-9]+\\s-\\{2\\}" "" example-code)))
(unless use-highlight-sc
(plist-put info :md-code example-code)
(plist-put info :md-code-attr code-attr-str)))
Expand Down

0 comments on commit fb728ea

Please sign in to comment.