Closed shayyya1 closed 1 year ago
Happens to me as well since obsidian 1.0
Please implement this plugin for version 1.0.0 as soon as possible. Thank you very much
This is expected behavior from a markdown point-of-view, but unexpected for Obsidian.
I also have this issue. Seems like removing a selector in assets/main.css is a quick fix: https://github.com/valentine195/obsidian-admonition/blob/2fb38ccc0b39ada8d3d0a4476e9ff3333c52c3ae/src/assets/main.css#L304-L306
The selector right before can also be removed: https://github.com/valentine195/obsidian-admonition/blob/2fb38ccc0b39ada8d3d0a4476e9ff3333c52c3ae/src/assets/main.css#L299-L302
This makes line paddings in live preview look almost identical to read mode.
For admonition:
`````````ad-info
title: Title
First line.
After a single line break comes a second line.
Two line breaks to a third line, followed by a multi line math block:
$$
z=re^{i \theta}
$$
A line break after the math block comes a fourth line.
Then comes some a long text without line-breaks that repeats. Then comes some a long text without line-breaks that repeats. Then comes some a long text without line-breaks that repeats.
Last line.
Before (Live-Preview):
![image](https://user-images.githubusercontent.com/6492687/199980566-70e0b467-52a6-4001-93e5-160f2bd62510.png)
After (Live-Preview):
![image](https://user-images.githubusercontent.com/6492687/199980798-3803310b-18cb-4295-9f36-d313e4bf99ac.png)
Read Mode:
![image](https://user-images.githubusercontent.com/6492687/199981439-7be550f5-078e-4cc6-81a1-21c6e7006fa7.png)
Puh, crisis averted. Thank you @rootless69 !
For everyone wondering how this works: remove the two CSS snippets @rootless69 posted above from the styles.css in your .obsidian\plugins\obsidian-admonition folder and restart Obisidan.
I know this is late, but I love you @rootless69 I was writing a few of these today and noticed that the line breaks were completely messed up. I sometimes write a few notes in one box and not having line breaks was making them hard to read.
Appreciate the fix.
Wonderful - worked a treat. For anyone that might be as 'green' as me: the styles.css file was not formatted and was just a mass of text. I opened it in Visual Studio Code and did a Alt+Shift+F and it all looked nice again and ready to edit :-)
Hi, I’ll remove these lines when I get a chance, but you should not edit plugin css directly. Use a CSS snippet. Otherwise the changes will be overwritten on a plugin update.
Look forward to the fix to be released
A sample css snippet that worked for me:
/* See https://github.com/valentine195/obsidian-admonition/issues/266#issuecomment-1303527540 */
.is-live-preview .admonition-content > * br {
display: inline;
}
.is-live-preview .admonition-content > * {
margin: revert;
}
Hello everyone.
The PR should fix this issue and the Mathjax issue with spacing as well. If you experience any issues further, please make a new issue.
When writing an admonition, lines seperated by line breaks in the code will not be seperated in the editing preview Results in