Doom-emacs: Trying to format HTML always yields an error message

Created on 26 Apr 2020  ·  8Comments  ·  Source: hlissner/doom-emacs

What did you expect to happen?

HTML code reformatted without error

What actually happened?

The format-all-erros buffer opened with the following errors

Config: unknown option: drop-empty-elements
Error: Can't open "no"

Config: missing or malformed argument for option: show-body-only
Error: Can't open "auto"

Config: unknown option: indent-with-tabs
Error: Can't open "no"

Additional details:

After checking the web-mode and so that formatter used is supposedly html-tidy which is not installed in my system. I installed it but I'm still getting the same error message.
Steps to reproduce:

  1. Open an HTML file
  2. M-x: +format/buffer
  3. Observe the error message

System information:


emacs version 26.3
features JPEG RSVG GLIB NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS
build Apr 26, 2020
buildopts (--prefix=/nix/store/m8p441vi16i5b7is67xla7iblxrqy4vf-emacs-26.3 --disable-build-details --with-modules --with-ns --disable-ns-self-contained CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200)
windowsys ns
daemonp server-running
doom version 2.0.9
build HEAD -> develop 6cb1390fa 2020-04-25 15:43:05 -0400
dir ~/.config/doom/
system type darwin
config x86_64-apple-darwin17.7.0
shell /run/current-system/sw/bin/fish
uname Darwin 19.4.0 Darwin Kernel Version 19.4.0: Wed Mar 4 22:28:40 PST 2020; root:xnu-6153.101.6~15/RELEASE_X86_64 x86_64
path (~/hacking/doom-emacs/bin/ ~/.nix-profile/bin/ /run/current-system/sw/bin/ /nix/var/nix/profiles/default/bin/ /usr/local/bin/ /usr/bin/ /usr/sbin/ /bin/ /sbin/ /nix/store/m8p441vi16i5b7is67xla7iblxrqy4vf-emacs-26.3/libexec/emacs/26.3/x86_64-apple-darwin17.7.0/)
config envfile envvar-file
elc-files 0
modules (:completion (company +childframe) (ivy +prescient +icons) :ui doom doom-dashboard doom-quit hl-todo modeline nav-flash ophints (popup +defaults) pretty-code treemacs unicode vc-gutter vi-tilde-fringe window-select workspaces :editor (evil +everywhere) file-templates fold (format +onsave) multiple-cursors rotate-text snippets :emacs (dired +ranger +icons) electric (ibuffer +icons) vc :term eshell :checkers syntax :tools direnv editorconfig (eval +overlay) (lookup +docsets) lsp macos magit pdf :lang data elm emacs-lisp (javascript +lsp) ledger markdown nix (org +brain +dragndrop +gnuplot +journal +pandoc +pomodoro +present) racket sh (web +lsp) :config (default +bindings +smartparens))
packages ((xo))
unpin (n/a)
elpa (n/a)

:editor format :lang web bug resolved

Most helpful comment

@teehemkay I'm getting this error as well, what version was this resolved on?

All 8 comments

Seems to be resolved in latest release, so I'll close this issue.

@teehemkay I'm getting this error as well, what version was this resolved on?

This issue still occurs

Happening to me too.

@gustavo-depaula @brorbw @actual-size

For me, this occurs due to the wrong version of tidy! There is a default tidy In macOS:

❯ which tidy
/usr/bin/tidy
❯ tidy --version
HTML Tidy for Mac OS X released on 31 October 2006 - Apple Inc. build 17.2

In macOS, simply install tidy-html5 by:

❯ brew search tidy
==> Formulae
perltidy            tidy-html5          tidyp

❯  brew install tidy-html5

And replace tidy with /usr/local/bin/tidy by, for example alias tidy=/usr/local/bin/tidy.

brew search tidy

@lroolle solved for me, thanks! although I didn't need to "replace tidy", brew took care of this, I guess.

@lroolle Actually I totally forgot that I already solved this issue exactly as you described it

Was this page helpful?
0 / 5 - 0 ratings