jQuery Plugin for HTML Editor with Syntax Coloring

后端 未结 5 1038
野性不改
野性不改 2021-01-30 14:55

I\'m looking for a jQuery Plugin that will display a textarea for HTML authoring & editing.

The things I\'m looking for:

  1. Must support authoring the H
5条回答
  •  走了就别回头了
    2021-01-30 15:22

    Use CodeMirror. It's the highlighter used by Google for their API playground.

    I've tried it and it works well, and according to their site it works in the following browsers:

    • Firefox 1.5 or higher
    • Internet Explorer 6 or higher
    • Safari 3 or higher
    • Opera 9.52 or higher
    • Chrome

    I don't understand why you mention jQuery in this case, since jQuery has nothing relevant to what you need to do, other than its selector engine which could be used to find the textbox you want to enable syntax highlighting for (although if you put an id on it you shouldn't need jQuery for that either.)

    It's better to go with a stand-alone library that is especially designed to solve the task at hand (which CodeMirror is.) You'll get maximum performance and it'll be much more maintainable by the developers, ensuring better quality of the code.

提交回复
热议问题