luis_miguel There is any way to offer some write "freedom" in that case?
Hi,
I wrote a little javascript. Paste the following code into /dokuwiki/conf/userscript.js
(create this file, if you haven't already done so):
var $onclickFunction = "jQuery(this).parent().find('textarea').val( jQuery(this).parent().find('textarea').val().replace(/[\\r\\n]/gm, ' \\\\\\\\\\\\\\\\ ') );" ;
jQuery("label.textareafield").parent().find('button[type="submit"]').attr('onclick', $onclickFunction);
Save the file, restart your browser and try it out!
It replaces invisible linebreaks in the textarea with DokuWiki syntax linebreaks \\
, when submit is clicked (and before submit is actually executed). If needed, this could be further customized to work only on certain pages, or only on single textareafields (identified by bureaucracy field label).
For example, if you want this script to modify a textarea only on a certain page you can go like this:
if ( JSINFO['id'] == 'namespace:mypage' ) {
var $onclickFunction = "jQuery(this).parent().find('textarea').val( jQuery(this).parent().find('textarea').val().replace(/[\\r\\n]/gm, ' \\\\\\\\\\\\\\\\ ') );" ;
jQuery("label.textareafield").parent().find('button[type="submit"]').attr('onclick', $onclickFunction);
}
... where namespace:mypage
is your page's id.
Cheers!