joeyuping / quick_latex_obsidian

MIT License
326 stars 21 forks source link

Add classes to the `.cm-line` element #116

Open OnkelTem opened 11 months ago

OnkelTem commented 11 months ago

Currently, when editing $$-block, no classes are added to the .cm-line elements, related to formula editor lines:

image

This makes it impossible to style the element. For example, in a custom theme or a snippet, if we add vertical paddings to paragraphs to achieve readability, it also affects formula editor where we don't need any extra paddings. W/o classes we just cannot negate the effect.

As a good example, I can refer to the regular code editor:

image

As you see, every .cm-line in the editor block gets extra classes like .HyperMD-codeblock. It allows to mitigate the negative impact of paragraph paddings:

.markdown-source-view.mod-cm6 .HyperMD-codeblock.cm-line {
  padding-bottom: 0;
}

I'm not sure if it's possible. Let me ask Obsidian folks.