icewind1991 / files_markdown

Nextcloud markdown editor
GNU Affero General Public License v3.0
293 stars 28 forks source link

Fix katex font #177

Closed st3iny closed 2 years ago

st3iny commented 3 years ago

Fix #112 Fix #168

The font of katex spans gets overwritten by a rule in preview.css. I fixed it by applying said rule to the preview container only. Font settings will be inherited to all children anyways.

Before

Screenshot 2021-09-21 at 12-23-00 test md - Dateien - Nextcloud

After

Screenshot 2021-09-21 at 12-21-58 test md - Dateien - Nextcloud

ffranchina commented 2 years ago

Thanks for this fix! Is there any news about its merge?

ffranchina commented 2 years ago

This fix solves a problem that, by default, appears using mermaid, too. The code

```mermaid
  graph TD;
    a-->0123456789;
```

produces Schermata da 2022-03-30 21-14-33

Basically mermaid expects to use its own font for computing the dimensions of the boxes. Without the fix, the CSS override every font usage from third-party plugins.

icewind1991 commented 2 years ago

Thanks!

LeducH commented 2 years ago

How can I use this workaround. I am on version 2.3.6 from the store. Is there a way I can integrate that change?

LeducH commented 2 years ago

I tried to change the file in the folder nextcloud_data/custom_apps/files_markdown/css/preview.css ~with the changes without any change is there a way around it?~

That will work as a workaround I just had problem with the cache in my browser