Currently when there is no "type" attribute in a tag, we can choose a default programming language for highlighting. Is it possible to let geshifilter choose the last language used in the input? For example,
<blockcode type="c">blockcode 1</blockcode>
<blockcode>blockcode 2</blockcode>
<blockcode>blockcode 3</blockcode>
<blockcode type="python">blockcode 4</blockcode>
<blockcode>blockcode 5</blockcode>
Now blockcode 1, 2, and 3 are highlighted in C but blockcode 4 and 5 is highlighted in Python. This will save some time when you're typing lots of code snippets.
I have not looked into the code but I presume this will not be very complicated. If I have some time I might look into it and do a patch.
(I got the idea from \lstset{} of LaTeX)
Comments
Comment #1
soxofaan commentedThis is not possible with the current version.
Also, I'm note sure if it would be a good idea to implement this.
Introducing a sort of context to the code block filtering is tricky and could introduce a lot of confusion to the user.
For example, if you want blockcode 3 to be highlighted with the default (which is no highlighting in most cases), how would you achieve this when you have a "sticky" mode?
I think it's just better to be explicit than to be implicit,
The cost of typing the extra 'lang="python"' is not that big, I think
Moreover, if you are concerned about typing, why don't you just enable language tags instead of the generic ones so you can write:
Comment #2
boombatower commentedPlease reopen if still relevant.