hniksic / emacs-htmlize

Convert buffer text and decorations to HTML.
192 stars 45 forks source link

All colouring lost. #34

Open tecosaur opened 3 years ago

tecosaur commented 3 years ago

If I run htmlize-{buffer,file} on any of my files, the result has no syntax highlighting.

Additionally, if I turn on debug-on-error I find the following

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("[\11\n]" nil 0)
  htmlize-untabify-string(nil 0)
  htmlize-extract-text(1 2 nil)
  ...
  htmlize-buffer-1()
  htmlize-region(1 1817)
  org-html-htmlize-region-for-paste(1 1817)

Here's an example output: colophon.zip

I use Emacs27.1 with Doom, which uses the latest version of Htmlize, and does not appear to modify the settings/behaviour.

hniksic commented 3 years ago

Thanks for the report. Here are some steps to debug the issue:

tecosaur commented 3 years ago

Sorry for the delay, I'll try doing emacs -Q shortly.

In Emacs

image

Htmlized

image

ipofanes commented 2 years ago

I am getting an output of non-formatted code after htmlize-file, while htmlize-buffer delivers the desired output with different text colours.