0

Is it possible to do this with vanilla emacs? If not what changes do I need to make.

Original test.html

<a id="try_redacted" target="_blank" href="http://redacted.com/game/2d/?try=1" style="right: -0.5em; bottom: 6em;"><img src="assets/img/try_redacted.png" alt="Try redacted" border="0" width="100%"></a>

End Result example.html

<a id="try_redacted" target="_blank" href="http://redacted.com/game/2d/?try=1" style="right: -0.5em; bottom: 6em;">
  <img src="assets/img/try_redacted.png" alt="Try redacted" border="0" width="100%">
</a>

M-x html-mode and M-x indent-region didn't seem to help.

  • I usually do a query-replace >< to >^J< to insert newlines between tags. Then select the whole buffer and indent-region. – Juancho Jun 13 at 16:31
0

The function te/maybe-expand-tag does that. The tagedit library advises fill-paragraph with it.

If you want to try install and activate tagedit-mode which is available on marmelade and melpa.

Afterwards you can just use fill-paragraph to get the tag-wise fill behavior. The function fill-paragraph is bound to the key sequence M-q.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.