Вопрос

Codemirror allows us to use variable height (see this demo with some markdown) and with the markdown syntax you can write a title with # or underline it with = or -.

Unfortunately variable height only works if tags and title are on the same line, if we use = the title is not bigger:

enter image description here

I have try to code something (jsfiddle) but it is hacky not very clean and don't work in all situations.

Someone has an idea? Is there a clean solution? Thank you in advance!

Это было полезно?

Решение 2

The issue was finally closed the 22 Jun 2017. The lookahead was implemented in CodeMirror 5.27.0.

The function lookAhead is able to handle the n-th line and thus is it possible to implement what I needed with a clean solution.

The variable height example was updated and the bug is not present anymore.

Другие советы

This is not currently possible, as CodeMirror doesn't support lookahead - the mode must decide how to style the header line before it gets to see the ====== line.

There is an open issue to add lookahead ability.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top