Normalizer.prototype.normalizeLine = function(lineNode) {
lineNode = Normalizer.wrapInline(lineNode);
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Quill JS HTML Editor</title>
<script src="quill.js"></script>
<style>
body {background: #fed;}
</style>
<script>
getEid = function(el){return document.getElementById(el);}
var delOutput = false, chCount=0;
function doTest() {
var h = quill0.getHTML();
getEid("tst100").innerHTML = h;
}
</script>
</head>
<body><h3>A test of the Quill Editor</h3>
<table style="border: 1px dashed #0b0;"><tr><td>
<div id="toolbar" style="border:1px solid #000; width: 16.25em; padding: 3px;">
<select class="ql-size">
<option value="10px">Small</option>
<option value="13px" selected>Normal</option>
<option value="18px">Large</option>
<option value="32px">Huge</option>
</select>
<button class="ql-bold">Bold</button>
<button class="ql-italic">Italic</button>
</div>
<!-- Create the editor container -->
<div id="editor" style="border: 3px solid #44b; border-top: 0; width: 20em;">
<div><span style="font-size: 10px; color: red;">line DIV one,</span> the Hello <span style="font-size: 18px;">World</span> Quill Editor!</div>
<div><span style="font-size: 10px; color: red;">line DIV two,</span> Some initial <b>bold</b> text in this second <span style="font-size: 18px;">to see how</span> the display auto creates the <b><span style="font-size: 18px;">line-breaks</span></b></div>
<div><span style="font-size: 10px; color: red;">line DIV three,</span> the third enforced line break area with some text that will display as three lines</div>
<div><br></div>
</div>
</td>
<td>
<button onclick="doTest()">View HTML in 100 height div</button>
<div id="tst100" style="border: 3px solid #44b; width: 16em; height: 100px; overflow: hidden; margin: 4px; padding: 4px; font-face: serif;">
NO TEST YET</div>
</td></tr></table>
<hr>
<span style="background: #dfd; font-size: 115%;">Development Info Output</span> - <button onclick="doHtml()">See All Editor's HTML</button>
<div id="dod1" style="width: 800px; border:2px dotted #c00; padding: 3px;">No Output Yet</div>
<script>
delOutput = getEid("dod1");
var quill0 = new Quill('#editor');
quill0.addModule('toolbar', { container: '#toolbar' });
quill0.on('text-change', function(delta, source) {
delOutput.innerHTML = chCount+' Editor contents have done "text-change" | <br>'+source;
chCount++;
});
//quill0.insertText(11, ' Bilbo');
//console.log(quill0.getText());
function doHtml( ) {
var h = quill0.getHTML();
h = h.replace(/</g, "<");
delOutput.innerHTML = 'Editor Button to see ALL HTML -<br>'+h;
}
</script>
</body></html>
When you click the "View HTML in 100 height div" button, you should see the HTML extracted from the quill editor, placed in to the <div id="tst100" > and not be more than 100 px high.<div>dksjf sdfhkjsfhdls</div>
Now in my code i want to display just the above div node on a different HTML page.... <link rel="stylesheet" href="//cdn.quilljs.com/0.20.1/quill.snow.css" />
<div class="ql-container ql-snow ql-editor">${preview}</div>
html body div#middle div.editbox div.editor-container div.editor.ql-container.ql-snow div#ql-editor-1.ql-editor div
"<div><span style="font-size: 32px;">robin</span> <b><i><u><s><span style="background-color: rgb(255, 235, 204);">suri</span></s></u></i></b></div><ul><li>robin robin</li></ul>"
var quill = editor.createQuill();
quill.on('text-change', function () {
var isEmpty = quill.getHTML().length === 0;
$('#submit').prop('disabled', isEmpty);
});
and my jsp has : fullEditor.setHTML(fullEditor.getHTML());
and notice how the space disappearsDocument.prototype.getHTML = function() {
return this.root.innerHTML.replace(/\>\s+\</g, '> <');
};
function doHtml( ) {
var h = quill0.getHTML();
var ln = h.length; // added this to get the length of string
h = h.replace(/</g, "<");
delOutput.innerHTML = ln+' Editor Button to see ALL HTML -<br>'+h;
}
And in fact, the -
Thanks for that.
Can u just point some lines in js file which help me understand this ...Just some pointers will be enough to get an idea why quill will only use div n list elements