Can emacs re-indent a big blob of HTML for me?

后端 未结 10 1986
生来不讨喜
生来不讨喜 2021-01-29 20:09

When editing HTML in emacs, is there a way to automatically pretty-format a blob of markup, changing something like this:

  
10条回答
  •  旧巷少年郎
    2021-01-29 20:53

    You can do a replace regexp

     M-x replace-regexp
    
     \(]+>\)
    
     \1C-q-j
    

    Indent the whole buffer

     C-x h
     M-x indent-region
    

提交回复
热议问题