mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-08 03:02:03 +01:00
stable :)
This commit is contained in:
parent
f466bcd32f
commit
c6b0c92061
3 changed files with 11 additions and 10 deletions
|
@ -393,9 +393,8 @@ const makeContentCollector = function (
|
|||
const tname = (dom.nodeTagName(node) || '').toLowerCase();
|
||||
const styl = dom.nodeAttr(node, 'style');
|
||||
const cls = dom.nodeAttr(node, 'class');
|
||||
|
||||
if (tname === 'img') {
|
||||
/*
|
||||
// no hook sare called in this branch, just a demo..
|
||||
hooks.callAll('collectContentImage', {
|
||||
cc,
|
||||
state,
|
||||
|
@ -404,12 +403,13 @@ const makeContentCollector = function (
|
|||
cls,
|
||||
node,
|
||||
});
|
||||
*/
|
||||
state.lineAttributes.img = node.src;
|
||||
// cc.doAttrib(state, 'img');
|
||||
// cc.startNewLine(state);
|
||||
|
||||
if (node.src) state.lineAttributes.img = node.src;
|
||||
this.breakLine = true;
|
||||
} else if (tname === 'br') {
|
||||
// Delete line Attributes that can pollute line breaks, they should only
|
||||
// be present in the line itself, not in any attributes of a line..
|
||||
// uncommenting the below will make duplicate images.. :)
|
||||
if (state.lineAttributes) delete state.lineAttributes;
|
||||
this.breakLine = true;
|
||||
const tvalue = dom.nodeAttr(node, 'value');
|
||||
const induceLineBreak = hooks.callAll('collectContentLineBreak', {
|
||||
|
@ -449,7 +449,6 @@ const makeContentCollector = function (
|
|||
return;
|
||||
}
|
||||
if (collectStyles) {
|
||||
if(tname === "img") debugger;
|
||||
hooks.callAll('collectContentPre', {
|
||||
cc,
|
||||
state,
|
||||
|
|
|
@ -97,7 +97,8 @@ domline.createDomLine = (nonEmpty, doesWrap, optBrowser, optDocument) => {
|
|||
});
|
||||
|
||||
if (img) {
|
||||
// do some shit with an image... cake
|
||||
preHtml += `<img src="${img[1]}">`;
|
||||
processedMarker = true;
|
||||
}
|
||||
|
||||
if (listType) {
|
||||
|
|
|
@ -72,7 +72,6 @@ linestylefilter.getLineStyleFilter = (lineLength, aline, textAndClassFunc, apool
|
|||
const attribsToClasses = (attribs) => {
|
||||
let classes = '';
|
||||
let isLineAttribMarker = false;
|
||||
top.console.log("attribs", attribs)
|
||||
// For each attribute number
|
||||
Changeset.eachAttribNumber(attribs, (n) => {
|
||||
// Give us this attributes key
|
||||
|
@ -92,6 +91,8 @@ top.console.log("attribs", attribs)
|
|||
classes += ` start:${value}`;
|
||||
} else if (linestylefilter.ATTRIB_CLASSES[key]) {
|
||||
classes += ` ${linestylefilter.ATTRIB_CLASSES[key]}`;
|
||||
} else if (key === 'img') {
|
||||
classes += ` img:${value}`;
|
||||
} else {
|
||||
classes += hooks.callAllStr('aceAttribsToClasses', {
|
||||
linestylefilter,
|
||||
|
|
Loading…
Reference in a new issue