dokuwiki-plugin-mdpage icon indicating copy to clipboard operation
dokuwiki-plugin-mdpage copied to clipboard

Editing a section edits the entire page, but cuts off the last 2 characters.

Open Jonathan-Richards opened this issue 4 years ago • 7 comments

This is a bug report.

Name Value
DokuWiki Version 2020-07-29 "Hogfather"
PHP Version 7.4.6
OS Darwin
Web Server Apache/2.4.46 (Unix) PHP/7.4.6

Details:

The "edit" button next to each header doesn't seem to respect markdown sections properly. If I click on one in a markdown block, it starts editing the entire page, but it cuts off the last 2 characters. In my case, this usually breaks the </markdown> tag by replacing it with </markdow, but it's always just the last two characters.

Jonathan-Richards avatar Oct 21 '20 20:10 Jonathan-Richards

Same issues for me.

The way I'm currently getting around it is by specifying markdown tags in each heading like this:

====== header 1 ======
<markdown>
Content
</markdown>
===== header 2 =====
<markdown>
Content
</markdown>

It's not convenient, but it makes section editing work as intended

Monklite avatar Oct 21 '20 22:10 Monklite

@Jonathan-Richards @legofarmer Thanks for reports. Could you give me any reproducible page contents?

mizunashi-mana avatar Oct 25 '20 10:10 mizunashi-mana

<markdown>
# header 1

## header 2

</markdown>

jonathan-golorry avatar Oct 26 '20 19:10 jonathan-golorry

===== section 1 =====

<markdown>
# header 1

## header 2

</markdown>

===== section 2 =====

This is also an interesting example. You get 3 edit buttons: one for header 1, one for section 1, and one for section 2. Keep in mind that the edit button appears at the end of the block defined by a header/section title. Editing the sections works properly, but editing the header is the whole page (minus 2 characters).

jonathan-golorry avatar Oct 26 '20 19:10 jonathan-golorry

@jonathan-golorry Thanks for examples.

The "edit" button next to each header doesn't seem to respect markdown sections properly.

Unfortunately, this is not a bug but is according to the spec. This plugin respects standard renderer of DokuWiki as possible. However, DokuWiki is less extensible and pluggable for syntax plugins and has some strange behavior which breaks coherence with syntax plugins. We should not use standard renderer to avoid its behavior, but because the purpose of this plugin is the less maintain cost and the coherent with DokuWiki styles, I will keep using standard renderer.

Editing the sections works properly, but editing the header is the whole page (minus 2 characters).

I confirmed this unexpected behavior. I will try to fix this issue.

mizunashi-mana avatar Oct 30 '20 09:10 mizunashi-mana

I'm not sure if this is related, but I've also noticed a rare bug when editing the entire page where a newline gets inserted before the last two characters, so it looks like:

</markdow
n>

I'm not sure how to reproduce it. It might be related to the lock expiring or having the page open in multiple tabs.

jonathan-golorry avatar Nov 02 '20 21:11 jonathan-golorry

Experiencing this, myself. I'll keep an eye out on what I'm doing to see if I can reliably reproduce it.

Fortyseven avatar Jun 03 '21 12:06 Fortyseven