This is a wiki bug, perhaps I’m wrong but I think it is.
This is a wiki bug, perhaps I’m wrong but I think it is.
When you copy paste a script to post it with the tag it is shown correctly.
However when you copy it from the browser all line breaks and multi spaces disappear and you get a looooong line of code, which works but make impossible the editing.
Note: I'm trying this with a mobile phone (Firefox and chrome) perhaps it works in a computer.
Pierre Hébert, searching on the internet you can find some dokuwiki plugins for code text.
I made a quick search and found https://www.dokuwiki.org/plugin:syntaxhighlighter3 in case you don't want to spend time searching.
]]>
< ![CDATA[
I don’t know if something changed but it seems lately the scrolling in the wiki from my phone is choppy. Somehow now I can scroll the right side separately, and this seems to be the cause.
]]>
< ![CDATA[
Another thing: I can’t select text by keyboard in edit mode.
]]>
< ![CDATA[
I didn’t brought any update to the wiki but there is a new release available, I will apply it, maybe this will fix things. I never tried from a mobile so I can’t tell.
Thanks TrianguloY for the link, you are right, I don’t wish to spend too much time googling 😉
]]>
< ![CDATA[
Done.
Tested on http://www.pierrox.net/android/applications/lightning_launcher/wiki/doku.php?id=drawing_with_script
Syntax highlighting works but is a bit weird.
]]>
< ![CDATA[
Ok, it works ‘fine’
I can in that chunk of code copy/paste line breaks and multi spaces.
It’s true the highlight is a bit…blocky. But highlight is not really necessary I think.
I also saw that this plugin need a different tag, so it is not automatically applied to already written pages. (We will need to update them)
After a bit more searching I found this two plugins (theoretically the 3 is newer, but perhaps you prefer the 2 because it is more documented) which uses the
tag. You can test them.
https://www.dokuwiki.org/plugin:code2
https://www.dokuwiki.org/plugin:code3
]]>
< ![CDATA[
Great. I think that an explicit tag is a better approach however because not everybody wants or needs highlighting.
]]>
< ![CDATA[
I get doubled line breaks when I copy a script from sxh. Better than no line breaks, but not perfect…
]]>
< ![CDATA[
Hmm, with chrome I also get double line breaks.
But with Firefox it works perfect (yay! Firefox! )
]]>
< ![CDATA[
Maybe we can add a “copy to clipboard” button.
]]>
< ![CDATA[
Tried with opera, working fine.
It seems like it’s a chrome problem
]]>
< ![CDATA[
Don’t expect me to have a look at the plugin code, I am not a fan of web technologies…
]]>
< ![CDATA[
I think in the config you can enable it. Let me check…
…nop. Or at least it doesn’t say anything.
But the code3 (link abobe) has it, perhaps it’s better…
]]>