{"id":35576,"date":"2015-04-09T09:10:16","date_gmt":"2015-04-09T09:10:16","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/html-post-editor-new\/"},"modified":"2015-05-13T15:25:40","modified_gmt":"2015-05-13T15:25:40","slug":"html-post-editor-new","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/html-post-editor-new\/","author":14342587,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.0.0","stable_tag":"trunk","tested":"4.1.42","requires":"4.1","requires_php":"","requires_plugins":"","header_name":"HTML Post Editor","header_author":"mortalis","header_description":"","assets_banners_color":"eeeeee","last_updated":"2015-05-13 15:25:40","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"","rating":3,"author_block_rating":0,"active_installs":200,"downloads":14993,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":[],"upgrade_notice":[],"ratings":{"1":"1","2":0,"3":"1","4":0,"5":"1"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1131215","resolution":"128x128","location":"assets"}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1131211","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1131211","resolution":"1","location":"assets"},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1131211","resolution":"2","location":"assets"},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1131211","resolution":"3","location":"assets"},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"1131211","resolution":"4","location":"assets"},"screenshot-5.png":{"filename":"screenshot-5.png","revision":"1131211","resolution":"5","location":"assets"},"screenshot-6.png":{"filename":"screenshot-6.png","revision":"1131211","resolution":"6","location":"assets"},"screenshot-7.png":{"filename":"screenshot-7.png","revision":"1131211","resolution":"7","location":"assets"},"screenshot-8.png":{"filename":"screenshot-8.png","revision":"1131211","resolution":"8","location":"assets"}},"screenshots":{"1":"HTML view of the post, line highlight and matching tag highlight","2":"Multicursor and highlighting of found occurrences of the selected word","3":"Search box with RegEx mode (searches for the word with different endings)","4":"Emmet abbreviation before","5":"Emmet abbreviation after","6":"Full screen mode","7":"Options page","8":"Saving options"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[35241,83,246,18863,18675],"plugin_category":[],"plugin_contributors":[81898],"plugin_business_model":[],"class_list":["post-35576","plugin","type-plugin","status-publish","hentry","plugin_tags-ace-editor","plugin_tags-admin","plugin_tags-html","plugin_tags-post-editor","plugin_tags-raw","plugin_contributors-mortalis","plugin_committers-mortalis"],"banners":{"banner":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/banner-772x250.png?rev=1131211","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/icon-128x128.png?rev=1131215","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-1.png?rev=1131211","caption":"HTML view of the post, line highlight and matching tag highlight"},{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-2.png?rev=1131211","caption":"Multicursor and highlighting of found occurrences of the selected word"},{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-3.png?rev=1131211","caption":"Search box with RegEx mode (searches for the word with different endings)"},{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-4.png?rev=1131211","caption":"Emmet abbreviation before"},{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-5.png?rev=1131211","caption":"Emmet abbreviation after"},{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-6.png?rev=1131211","caption":"Full screen mode"},{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-7.png?rev=1131211","caption":"Options page"},{"src":"https:\/\/ps.w.org\/html-post-editor-new\/assets\/screenshot-8.png?rev=1131211","caption":"Saving options"}],"raw_content":"<!--section=description-->\n<p>The plugin adds <strong>HTML editor<\/strong> to the default post editor. The editor is accessible through a new <strong>HTML tab<\/strong>. When opening the tab the editor loads the raw HTML source of the post, formats it and applies <strong>Ace Editor<\/strong> to the input area. So the edit area has main features from this web editor: <em>syntax highlight, line numbers, highlight of matching tags and brackets, keyboard shortcuts<\/em>.<\/p>\n\n<p>The plugin is based on the <a href=\"https:\/\/wordpress.org\/plugins\/ace-editor-for-wp\/\">ACE Editor for WP<\/a> plugin. It's updated for <em>Wordpress 4.1<\/em> and <em>Ace editor 1.1.8<\/em>.<\/p>\n\n<h4>Features<\/h4>\n\n<ul>\n<li>Syntax highlighting<\/li>\n<li>Line numbers<\/li>\n<li>Line highlighting<\/li>\n<li>Highlight of matching tags and brackets<\/li>\n<li>Syntax checking<\/li>\n<li>Multicursor<\/li>\n<li>Ace Editor keyboard shortcuts<\/li>\n<li>Search box<\/li>\n<li>Resizable area<\/li>\n<li>Emmet HTML snippets<\/li>\n<li>Full screen mode<\/li>\n<li>Toggle word wrap option<\/li>\n<li>Custom shortcuts<\/li>\n<li>Options page<\/li>\n<\/ul>\n\n<h4>Usage<\/h4>\n\n<ol>\n<li>Before switching to the <strong>HTML tab<\/strong> first make sure you are on the <strong>Visual tab<\/strong> because the script loads the data from the <em>TinyMCE<\/em> editor which is loaded only when the <strong>Visual tab<\/strong> activates. <\/li>\n<li>When you are on the <strong>Text tab<\/strong> the <em>HTML tab<\/em> is disabled and has a <em>light red background<\/em> so you won't be able to switch to it until you activate the <strong>Visual tab<\/strong>. <\/li>\n<li>When the <strong>HTML tab<\/strong> is activated the <em>Text tab<\/em> becomes disabled so you may only switch to the <strong>Visual tab<\/strong>. This is done to prevent the <em>conflicts<\/em> of content which is loaded when appropriate tab is activated.<\/li>\n<li>If you edit some content in the <strong>HTML mode<\/strong> and want to <em>save<\/em> it and <em>update the post<\/em> first switch to the <strong>Visual tab<\/strong> so the edited HTML code loads to the <strong>TinyMCE editor<\/strong>. It's <em>required<\/em> because the content synchronization is performed only after <em>switching off the HTML tab<\/em>.<\/li>\n<\/ol>\n\n<h4>Working with features<\/h4>\n\n<ol>\n<li><strong>Multicursor<\/strong> lets you edit multiple regions at the same time. You can use <strong>default shortcuts<\/strong> to add remove regions or select multiple blocks with mouse holding <strong>Ctrl key<\/strong>.<\/li>\n<li><strong>Default keyboard shortcuts<\/strong> for the <em>Ace editor<\/em> can be found on the <a href=\"https:\/\/github.com\/ajaxorg\/ace\/wiki\/Default-Keyboard-Shortcuts\">Ace GitHub Wiki<\/a> page or on the <a href=\"http:\/\/pcadvice.co.nf\/blog\/ace-editor-shortcuts\/\">Ace Editor Shortcuts<\/a> page I created for the Wordpress version of this editor. Here I selected some shortcuts and <em>organized<\/em> them by <em>categories<\/em>.<\/li>\n<li><strong>The Search box<\/strong> gives additional functions:\n\n<ul>\n<li>Search All instances<\/li>\n<li>Use of Regular expressions<\/li>\n<li>Whole word search<\/li>\n<li>Replace content<\/li>\n<li>Replace All<br \/>\nIt shows with <strong>Ctrl+F<\/strong> and <strong>Ctrl+H<\/strong> combinations.<\/li>\n<\/ul><\/li>\n<li>The editor area can be <strong>resized<\/strong> using the <em>bottom (southern) handle<\/em> but it doesn't remember its size after switching.<\/li>\n<li><strong>Emmet snippets<\/strong> are used to improve code typing. The <em>documentation<\/em>: \n\n<ul>\n<li><a href=\"http:\/\/docs.emmet.io\/abbreviations\/\">Basic Usage<\/a><\/li>\n<li><a href=\"http:\/\/docs.emmet.io\/cheat-sheet\">Full list<\/a> of HTML and CSS snippets<\/li>\n<\/ul><\/li>\n<li><strong>Full screen mode<\/strong> is not a default Ace Editor feature. I've taken the idea from a <strong>demo<\/strong> page in the <a href=\"https:\/\/github.com\/ajaxorg\/ace-builds\/tree\/master\/demo\">Ace build package<\/a>. The page is named <strong>scrollable-page.html<\/strong>.<br \/>\nIt adds a new custom shortcut to the editor which toggles the <strong>full\/normal<\/strong> mode. So I set this function to the <strong>F11<\/strong> key.<br \/>\nThe function extends the editor container to the Wordpess admin boundaries but doesn't hide <strong>top and left menus<\/strong>. It also works if the <em>window size<\/em> is changed or the left menu is <em>collapsed<\/em>. But to fill the available space in these cases the <strong>F11<\/strong> key must be pressed <em>two times<\/em> when the editor is in the <em>full screen mode<\/em>.<br \/>\nIf you need to change this F11 key to other write me a request and I'll add an option to the options page.<\/li>\n<li><strong>The Word Wrap<\/strong> checkbox appears when the <strong>HTML tab<\/strong> is switched to. By default the editor has word wrapping <em>enabled<\/em>. You can toggle this option with the checkbox. But it only remembers its state in the <em>current editor session<\/em>.<\/li>\n<li>I've also added some <strong>custom shortcuts<\/strong>:\n\n<ul>\n<li><strong>Ctrl+Enter<\/strong> adds a new line below the current one regardless of what is the current position the cursor on the current line<\/li>\n<li><strong>Ctrl+R<\/strong> switches to the <em>Visual tab<\/em><\/li>\n<\/ul><\/li>\n<\/ol>\n\n<h4>The Options Page<\/h4>\n\n<ol>\n<li><strong>Font size<\/strong> of the editor may be set in any CSS units <em>(px, pt, em)<\/em>.<\/li>\n<li><strong>Editor themes<\/strong> dropdown shows default <strong>Ace Editor<\/strong> theme list plus my custom theme <strong>Sublime<\/strong> which is the default theme for the plugin.<\/li>\n<li><strong>The options form<\/strong> is submitted using <strong>Ajax<\/strong> so the <strong>page doesn't reload<\/strong>, just wait until the save button is <em>enabled<\/em> and the <em>success message<\/em> appears at the top. Then reload the edit post page to see the editor changes.<\/li>\n<\/ol>\n\n<h4>Other Notes<\/h4>\n\n<ol>\n<li><strong>Emmet plugin<\/strong> works on the <em>specially built package<\/em> for the <strong>Ace Editor<\/strong>. Its source is <a href=\"https:\/\/github.com\/cloud9ide\/emmet-core\">here<\/a>. And I reduced its size by removing the <em>Underscore.js<\/em> part and <em>CSS snippets<\/em>. So the <strong>final package<\/strong> is <a href=\"https:\/\/github.com\/mortalis13\/emmet-for-ace-css\">here<\/a>.<\/li>\n<li>When the <strong>HTML tab<\/strong> is loaded the <em>source code<\/em> is first represented as one long line. So I used the <a href=\"https:\/\/github.com\/beautify-web\/js-beautify\/tree\/master\/js\">JS Beautifier<\/a> tool and exactly its <strong>beautify-html.js<\/strong> subscript to format that line so it has some readable structure. Additionally I applied my own function to have some blank lines before <code>&lt;hx&gt;<\/code>, <code>&lt;p&gt;<\/code> and <code>&lt;pre&gt;<\/code> tags.<\/li>\n<li>I've put only the <em>minified version<\/em> of the <strong>Ace Editor<\/strong> scripts to the plugin package. To get the full <strong>uncompressed<\/strong> files go to its <a href=\"https:\/\/github.com\/ajaxorg\/ace-builds\">GitHub repository<\/a>.<\/li>\n<\/ol>\n\n<h4>Resource Links<\/h4>\n\n<ol>\n<li><a href=\"http:\/\/ace.c9.io\">Ace Editor Main Site<\/a> and <a href=\"https:\/\/github.com\/ajaxorg\/ace\">GitHub repository<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/ajaxorg\/ace-builds\">Ace Builds GitHub repository<\/a> with sources.<\/li>\n<li><a href=\"https:\/\/github.com\/ajaxorg\/ace-builds\/tree\/master\/demo\">Ace Editor Demo Pages<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/ajaxorg\/ace\/wiki\/Default-Keyboard-Shortcuts\">Ace Editor Keyboard Shortcuts<\/a> and <a href=\"http:\/\/pcadvice.co.nf\/blog\/ace-editor-shortcuts\">my edition<\/a>.<\/li>\n<li>Emmet plugin: <a href=\"http:\/\/emmet.io\">Main Site<\/a>, <a href=\"http:\/\/docs.emmet.io\">Documentation<\/a>, <a href=\"http:\/\/docs.emmet.io\/cheat-sheet\">List of Abbreviations<\/a>.<\/li>\n<li><a href=\"https:\/\/github.com\/mortalis13\/emmet-for-ace-css\">Special Emmet package<\/a> for the Ace Editor.<\/li>\n<li><a href=\"https:\/\/github.com\/beautify-web\/js-beautify\/tree\/master\/js\">JS Beautifier<\/a>.<\/li>\n<\/ol>\n\n<p>This plugin's GitHub repository: https:\/\/github.com\/mortalis13\/html-post-editor.<\/p>\n\n<h4>Detected Problems<\/h4>\n\n<ul>\n<li>When switching to the full-screen mode (F11) and the \"Enable full-height editor and distraction-free functionality\" Screen option is enabled the post tabbar stays on the front.<\/li>\n<li>If cursor doesn't match its established position (e.g., should be in the line end after the last character but displays with offset to the left) try installing Consolas fonts to the Fonts folder (this problem detected in Windows XP where no Consolas fonts installed by default). Install all 4 types of Consolas (Regular, Bold, Italic, Bold Italic). I've taken them from Windows 7 Fonts folder.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>html-post-editor<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<li>Open edit post page (add new or edit existing post).<\/li>\n<li>Switch to the HTML tab and check the editor loads the HTML source of the post.<\/li>\n<\/ol>","raw_excerpt":"Adds HTML tab to the post editor which shows the raw source of the page and is highlighted with the Ace Editor","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/35576","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=35576"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/mortalis"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=35576"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=35576"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=35576"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=35576"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=35576"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=35576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}