From 66109002efc6f3de41885c071e0c473ebdfc342b Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 14 Jan 2021 12:58:06 +0000 Subject: [PATCH] placeholder commit --- src/static/js/contentcollector.js | 10 +++++++--- src/static/js/domline.js | 4 ++++ src/static/js/linestylefilter.js | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/static/js/contentcollector.js b/src/static/js/contentcollector.js index 28cf5ddff..df84b34c4 100644 --- a/src/static/js/contentcollector.js +++ b/src/static/js/contentcollector.js @@ -395,6 +395,7 @@ const makeContentCollector = function ( const cls = dom.nodeAttr(node, 'class'); if (tname === 'img') { + /* hooks.callAll('collectContentImage', { cc, state, @@ -403,8 +404,11 @@ const makeContentCollector = function ( cls, node, }); - // cc.doAttrib(state, 'image:foo.png'); - state.lineAttributes.img = 'foo.png'; + */ + state.lineAttributes.img = node.src; +// cc.doAttrib(state, 'img'); +// cc.startNewLine(state); + } else if (tname === 'br') { this.breakLine = true; const tvalue = dom.nodeAttr(node, 'value'); @@ -444,8 +448,8 @@ const makeContentCollector = function ( // for now it shows how to fix the problem return; } - if (collectStyles) { + if(tname === "img") debugger; hooks.callAll('collectContentPre', { cc, state, diff --git a/src/static/js/domline.js b/src/static/js/domline.js index a341500b1..c3dac2ccc 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -82,6 +82,8 @@ domline.createDomLine = function (nonEmpty, doesWrap, optBrowser, optDocument) { let lineClass = 'ace-line'; result.appendSpan = function (txt, cls) { +console.log("cls", cls); + // console.log("domline", domline, "txt", txt, "cls", cls) let processedMarker = false; // Handle lineAttributeMarker, if present if (cls.indexOf(lineAttributeMarker) >= 0) { @@ -97,6 +99,8 @@ domline.createDomLine = function (nonEmpty, doesWrap, optBrowser, optDocument) { processedMarker |= modifier.processedMarker; }); + + if (listType) { listType = listType[1]; if (listType) { diff --git a/src/static/js/linestylefilter.js b/src/static/js/linestylefilter.js index ddab47224..e005d1503 100644 --- a/src/static/js/linestylefilter.js +++ b/src/static/js/linestylefilter.js @@ -73,7 +73,7 @@ linestylefilter.getLineStyleFilter = function (lineLength, aline, textAndClassFu function 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