source-editing/utils/formathtml
@ckeditor/ckeditor5-source-editing/src/utils/formathtml
Filtering
Functions
-
formatHtml( input ) → String
A simple (and naive) HTML code formatter that returns a formatted HTML markup that can be easily parsed by human eyes. It beautifies the HTML code by adding new lines between elements that behave like block elements (https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements and a few more like
tr
,td
, and similar ones) and inserting indents for nested content.WARNING: This function works only on a text that does not contain any indentations or new lines. Calling this function on the already formatted text will damage the formatting.
Parameters
input : String
An HTML string to format.
Returns
String
Every day, we work hard to keep our documentation complete. Have you spotted an outdated information? Is something missing? Please report it via our issue tracker.