I come with an update. Actually, the edit buttons disappear because they are explicitly hidden, on PARSER_WIKITEXT_PREPROCESS:
global $conf; $conf['maxseclevel'] = 0;
But if I disable the line, the edit buttons appear, but they don't work correctly. E.g. the following macro replaces the $text expression, with a predefined text, that has 28 characters:
{{$test=
This text has 28 characters.
$}}
I have the following wiki page:
====== Pag 1 ======
===== Headline1 =====
$test
==== Headline2 ====
That renders like this:
Pag 1
Headline1
This text has 28 characters.
Headline2
But when I hit the edit button for Headline1, this is what I get:
===== Headline1 =====
$test
==== Headline2 ====
<h
It seems that dokuwiki calculates the indexes for sections AFTER the macros plugin has done the insertion. Is that caused because the replacing gets done in the PARSER_WIKITEXT_PREPROCESS event?
$controller->register_hook('PARSER_WIKITEXT_PREPROCESS', 'BEFORE', $this, '_macros_pre', NULL);
Should the replace of the text be done on another event? I assume that the replace was done early in the flow, so that the macro text may contain wiki syntax, that's parsed afterwards.
Best regards,
Cristian