mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-08 11:12:01 +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 tname = (dom.nodeTagName(node) || '').toLowerCase();
|
||||||
const styl = dom.nodeAttr(node, 'style');
|
const styl = dom.nodeAttr(node, 'style');
|
||||||
const cls = dom.nodeAttr(node, 'class');
|
const cls = dom.nodeAttr(node, 'class');
|
||||||
|
|
||||||
if (tname === 'img') {
|
if (tname === 'img') {
|
||||||
/*
|
// no hook sare called in this branch, just a demo..
|
||||||
hooks.callAll('collectContentImage', {
|
hooks.callAll('collectContentImage', {
|
||||||
cc,
|
cc,
|
||||||
state,
|
state,
|
||||||
|
@ -404,12 +403,13 @@ const makeContentCollector = function (
|
||||||
cls,
|
cls,
|
||||||
node,
|
node,
|
||||||
});
|
});
|
||||||
*/
|
if (node.src) state.lineAttributes.img = node.src;
|
||||||
state.lineAttributes.img = node.src;
|
this.breakLine = true;
|
||||||
// cc.doAttrib(state, 'img');
|
|
||||||
// cc.startNewLine(state);
|
|
||||||
|
|
||||||
} else if (tname === 'br') {
|
} 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;
|
this.breakLine = true;
|
||||||
const tvalue = dom.nodeAttr(node, 'value');
|
const tvalue = dom.nodeAttr(node, 'value');
|
||||||
const induceLineBreak = hooks.callAll('collectContentLineBreak', {
|
const induceLineBreak = hooks.callAll('collectContentLineBreak', {
|
||||||
|
@ -449,7 +449,6 @@ const makeContentCollector = function (
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (collectStyles) {
|
if (collectStyles) {
|
||||||
if(tname === "img") debugger;
|
|
||||||
hooks.callAll('collectContentPre', {
|
hooks.callAll('collectContentPre', {
|
||||||
cc,
|
cc,
|
||||||
state,
|
state,
|
||||||
|
|
|
@ -97,7 +97,8 @@ domline.createDomLine = (nonEmpty, doesWrap, optBrowser, optDocument) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (img) {
|
if (img) {
|
||||||
// do some shit with an image... cake
|
preHtml += `<img src="${img[1]}">`;
|
||||||
|
processedMarker = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (listType) {
|
if (listType) {
|
||||||
|
|
|
@ -72,7 +72,6 @@ linestylefilter.getLineStyleFilter = (lineLength, aline, textAndClassFunc, apool
|
||||||
const attribsToClasses = (attribs) => {
|
const attribsToClasses = (attribs) => {
|
||||||
let classes = '';
|
let classes = '';
|
||||||
let isLineAttribMarker = false;
|
let isLineAttribMarker = false;
|
||||||
top.console.log("attribs", attribs)
|
|
||||||
// For each attribute number
|
// For each attribute number
|
||||||
Changeset.eachAttribNumber(attribs, (n) => {
|
Changeset.eachAttribNumber(attribs, (n) => {
|
||||||
// Give us this attributes key
|
// Give us this attributes key
|
||||||
|
@ -92,6 +91,8 @@ top.console.log("attribs", attribs)
|
||||||
classes += ` start:${value}`;
|
classes += ` start:${value}`;
|
||||||
} else if (linestylefilter.ATTRIB_CLASSES[key]) {
|
} else if (linestylefilter.ATTRIB_CLASSES[key]) {
|
||||||
classes += ` ${linestylefilter.ATTRIB_CLASSES[key]}`;
|
classes += ` ${linestylefilter.ATTRIB_CLASSES[key]}`;
|
||||||
|
} else if (key === 'img') {
|
||||||
|
classes += ` img:${value}`;
|
||||||
} else {
|
} else {
|
||||||
classes += hooks.callAllStr('aceAttribsToClasses', {
|
classes += hooks.callAllStr('aceAttribsToClasses', {
|
||||||
linestylefilter,
|
linestylefilter,
|
||||||
|
|
Loading…
Reference in a new issue