You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * @class test * @singleton *//** * Get the actual inner HTML of a DOM node. * * In most browsers, .innerHTML is broken and eats newlines in `<pre>` elements, see * https://bugzilla.mozilla.org/show_bug.cgi?id=838954 . This function detects this behavior * and works around it, to the extent possible. `<pre>\nFoo</pre>` will become `<pre>Foo</pre>` * if the browser is broken, but newlines are preserved in all other cases. * * @method properInnerHtml * @param {HTMLElement} element HTML element to get inner HTML of * @returns {string} Inner HTML *//** * Get the actual outer HTML of a DOM node. * * @see #properInnerHtml * * @method properOuterHtml * @param {HTMLElement} element HTML element to get outer HTML of * @returns {string} Outer HTML *//** * Helper function for #properInnerHtml and #properOuterHtml. * * Detect whether the browser has broken `<pre>` serialization, and if so return a clone * of the node with extra newlines added to make it serialize properly. If the browser is not * broken, just return the original node. * * @method fixupPreBug * @param {HTMLElement} element HTML element to fix up */
I get:
Warning: Unclosed HTML tag: <pre>
Warning: Unclosed HTML tag: <pre>
Rendering like:
The text was updated successfully, but these errors were encountered:
The backwards-compatibility fix for code like:
Here's the code example:<pre><code>
alert("Blah");
</code></pre>
was a bit too lose. So tightened it up to only apply in case
where the <pre> or <pre><code> is at the end of line.
Fixes: #380
Given the following (based on VisualEditor:/modules/ve/ve/.js@4c5c18c241):
I get:
Rendering like:
The text was updated successfully, but these errors were encountered: