Probably related to the fact that the structure elements (meta) and the attribute name (atom) are still displayed although "hidden" by the background color assignment.
Probably the css attributes for positioning the icon are not adapted when the "meta" tags are removed. Also, it may be necessary to specify the "display: inline;" for the decoration.
Bravo for the PR tested with the latest Edge version: it works very well!
In addition, I publish below a small code called by Alt+Ctrl+a which:
reveals the structural elements and the name of the attributes
hides the display of decorations
like the PR but of all the attributes of a page.
Attributes are also highlighted with coloring and a border.
Modality: the code manipulates the DOM by adding temporarily a class in the body of the page. This class then does the work. The datas are not modified.
Normal display is restored by calling the command again with Ctrl+Alt+a or by refreshing the page.
The space-lua:
-- slashCommand.define
command.define {
name = "toggle-attr-display",
key = "Ctrl-Alt-a",
run = function()
local body = js.window.document.body
if not body then
editor.flashNotification("Body inaccessible")
return
end
local classStr = body.className or ""
local hasAlt = string.find(classStr, "attr%-alt%-display") and true or false
if hasAlt then
body.className = string.gsub(classStr, "%s*attr%-alt%-display", "")
editor.flashNotification("Affichage attribut : normal")
else
body.className = classStr .. " attr-alt-display"
editor.flashNotification("Affichage attribut : alternatif")
end
end
}
and the css:
/* priority: 10 */
/* pour dévoiler les meta et le nom d'un attribut
via l'appel d'une commande*/
body.attr-alt-display .sb-attribute {
background: yellow;
color: black;
border: 1px solid orange !important ;
}
body.attr-alt-display .sb-attribute> .sb-list.sb-frontmatter.sb-meta {
display: inline !important;
}
body.attr-alt-display .sb-attribute> .sb-list.sb-frontmatter.sb-atom {
display: inline !important;
}
It was actually much easier than I initially thought. The main source of confusion for me was that using the #sb-main .cm-editor prefix is important to reliably override CodeMirror's styling.
Here's the minimal working solution to strike only the task text while leaving attributes unaffected:
Just to point out that as of the edge version released this afternoon (2.4.1-140224571ee82d0c1f34446e4d144045f00038b9) the attribute name and value spans have consistent typed classes: