stable :)

This commit is contained in:
John McLear 2021-01-14 14:03:29 +00:00
parent f466bcd32f
commit c6b0c92061
3 changed files with 11 additions and 10 deletions

View file

@ -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,

View file

@ -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) {

View file

@ -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,