Is there a functionality like Sublime's “HTML: Encode Special Characters” in Intellij IDEA

耗尽温柔 提交于 2019-12-07 00:53:20

问题


I'm looking something like the functionality given in Sublime Text by the shortcut (windows) Ctrl + Shift + P named "HTML: Encode Special Characters" but in IntelliJ IDEA. This functionality is able to transform this (as a example):

I'm a special character phrase "áéíóú ñ"

Into this:

I'm a special character phrase "áéíóú ñ"

Only by surrounding the specified text and pressing the shortcut key combination given above (again, in windows Ctrl + Shift + P).

Any thoughts?

UPDATE (07-04-2016)

By now, Intellij Idea support this feature natively (version 2016). You need to select the text you want to transform and (in OSX) Cmd+Shift+A and type "Encode" then select the action "Encode XML/HTML Special Characters"

The only caveats are that this only works (to my knowledge) in html strings.


回答1:


It is not supported by IntelliJ directly, but a plugin called String Manipulation can help

From the plugin page:

Provide actions for text manipulation:

  • Un/Escape selected Java text
  • Un/Escape selected JavaScript text
  • Un/Escape selected HTML text
  • Un/Escape selected XML text
  • Un/Escape selected SQL text
  • Un/Escape selected PHP text
  • Trim selected text
  • Trim all spaces in selected text
  • Remove all spaces in selected text
  • De/Encode selected text as URL
  • Convert selected text to Camel Case
  • Convert selected text to Constant Case
  • Capitalize selected text
  • Encode selected text to MD5 Hex16
  • De/Encode selected text to Base64
  • Remove empty lines
  • Convert non ASCII to escaped Unicode
  • Convert escaped Unicode to String
  • Grep selected text, All lines not matching input text wil be removed. (Does not work in column mode)
  • Increment/Decrement selected text. Duplicate line and increment/decrement all numbers found.


来源:https://stackoverflow.com/questions/22367890/is-there-a-functionality-like-sublimes-html-encode-special-characters-in-int

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!