Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All colouring lost. #34

Open
tecosaur opened this issue Sep 13, 2020 · 3 comments
Open

All colouring lost. #34

tecosaur opened this issue Sep 13, 2020 · 3 comments

Comments

@tecosaur
Copy link

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
Copy link
Owner

hniksic commented Sep 27, 2020

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

  • Does htmlize work for you outside of org mode? For example, if you visit a file and type M-x htmlize-buffer RET?
  • If you get the same error, does it work if you use emacs -q?
  • What is the output of M-: (htmlize-buffer-substring-no-invisible 1 2) RET in the buffer where htmlize doesn't work?

@tecosaur
Copy link
Author

tecosaur commented Oct 7, 2020

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

  • Calling htmlize-file on a non-org file produces the same result (see below)
  • (htmlize-buffer-substring-no-invisible 1 2) gives "["

In Emacs

image

Htmlized

image

@ipofanes
Copy link

ipofanes commented Sep 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants