fnagel / beautyofcode

TYPO3 CMS Extension beautyofcode
https://extensions.typo3.org/extension/beautyofcode/
GNU General Public License v2.0
6 stars 8 forks source link

Add support for <kbd> and <samp> #30

Open fnagel opened 5 years ago

fnagel commented 5 years ago

Taken from https://forge.typo3.org/issues/73643

--

Use case: consistent formatting of sample output (which is not code) via

<samp>

There's a similar issue for prism: https://github.com/PrismJS/prism/issues/867

As far as I can see this is not yet implemented for prism, maybe it will be available in the future.

fnagel commented 5 years ago

I guess this needs to be implemented for specific languages when using Prism, right?

Seems possible. Ping me again when it's possible with Prism!

fnagel commented 5 years ago

FYI: @thomaszbz

fnagel commented 5 years ago

Seems this is not supported yet by Prism. Any ideas how to proceed here?

thomaszbz commented 5 years ago

I think it would be sufficient to treat kbd/samp elements like code elements. Widening the selector seems to be the way to go as suggested in https://github.com/PrismJS/prism/issues/867

The highlighting language would still be selectable like it is for a code element. So there is no logic between element and highlighting language.

Why not go for https://github.com/PrismJS/prism/issues/867#issuecomment-370223706 ?

When writing content in TYPO3, there should still be a way to say if kbd or samp or code element is rendered. But that's out of the scope of prism in any way.