Book keeping page is really messed up

Post any bugs, problems or feature requests here.
RemcoSwenker
RemcoSwenker
Brend
Brend
User avatar
RemcoSwenker
 
I have a problem with my book keeping page as it is showing 3 merged trades for some reason.

this is the wiki code and the ettachment is what it made
Code: Select all
<data !trade #Daryan MTCF payment>
From [ref]: Shaskar System
To [ref]: Lumo Duo System
Tax: 450
</​data>​

<data !trade #Gasses sale (proxy to Smi-Halek>
From [ref]: Shaskar System
To [ref]: Novalia System
Gasses: 411
</​data>​

==== Corporation Income ====

<data !trade #DVF Royalties>
To [ref]: ShasKar System
Tax: 32
</data>
Attachments
Book keeping bug.png
Book keeping bug.png (16.08 KiB) Viewed 1008 times
Post Brend » Sun Jul 06, 2014 3:44 pm
User avatar
Brend
 
I can't muck around cause Chriz has already locked the page ^_^

Hopefully he finds the problem, and tells us here.

I'm working on it right now.
Post Brend » Sun Jul 06, 2014 3:53 pm
User avatar
Brend
 
You've stumbled upon something strange. The following code seems problematic for unknown reasons.

I will be rambling a bit in this post; I will use these notes later to fix the problem.

Code: Select all
===== Test =====

<data trade #Gasses sale>
From [ref]: Shaskar System
To [ref]: Novalia System
Gasses: 411
</​data>​

<data trade #DVF Royalties>
To [ref]: ShasKar System
Tax: 32
</data>


The other way around seems to break the second box:
Code: Select all
===== Test =====

<data trade #DVF Royalties>
To [ref]: ShasKar System
Tax: 32
</data>

<data trade #Gasses sale>
From [ref]: Shaskar System
To [ref]: Novalia System
Gasses: 411
</​data>​


Actually:
Code: Select all
===== Test =====

<data trade #Gasses sale>
</​data>​

<data trade #DVF Royalties>
</data>


alreayd gives:
  • I don't understand data entry line '</​data>​'
  • I don't understand data entry line '<data trade #DVF Royalties>'

Eureka!

Ok. I have found the source of the problem:

The first </​data>​ contains strange characters.

If we look at the text with url encoding (through, for example, this tool), your wiki source becomes really really convoluted:
  • </​data>​: %3C%2F%E2%80%8Bdata%3E%E2%80%8B
  • </data>: %3C%2Fdata%3E
(You can try it yourself, if you select the first monospaced data close tag in the list.)

The extras (the %E2%80%8B) is one of the illustrous UTF-8 characters: U+200B, also known as ZERO WIDTH SPACE (There is a whole family!)
Post RemcoSwenker » Sun Jul 06, 2014 4:03 pm
User avatar
RemcoSwenker
 
for your information i copied a bit form an old revision beacause of a mistaken update.

where i did a select, copy and paste form the revision diff tool. and then i removed all unneccecary white space.

i hope that tha helps
Post Brend » Sun Jul 06, 2014 4:10 pm
User avatar
Brend
 
RemcoSwenker wrote:for your information i copied a bit form an old revision beacause of a mistaken update.

where i did a select, copy and paste form the revision diff tool. and then i removed all unneccecary white space.


This apparently introduced zero-width-spaces. Maybe the revision diff toll inserts them for some unknown (and probably ridiculous) reason.

RemcoSwenker wrote:i hope that tha helps


Well yes. The fix is simple: I'll just edit the page and literally retype the affected part.

EDIT: It is fixed.
Post Brend » Sun Jul 06, 2014 4:14 pm
User avatar
Brend
 
I'll look into why the revision tool generates zero-width-spaces.

(Notes for myself: https://github.com/splitbrain/dokuwiki/ ... c/html.php, https://github.com/splitbrain/dokuwiki/ ... Engine.php)
Post Brend » Sun Jul 06, 2014 4:51 pm
User avatar
Brend
 
Remco, with the diff tool, did you use table or inline view?
Post RemcoSwenker » Mon Jul 07, 2014 12:11 am
User avatar
RemcoSwenker
 
i had the standard side by side view
Post Brend » Sun Jul 20, 2014 9:56 pm
User avatar
Brend
 
Ok. I've traced down the code in the wiki engine that inserts these zero-width-space thingies. Long story short: I'm not fixing it, and you shouldn't copy from the diff view directly.

Instead, open the revision you want to source from as a page, and edit it to get to the actual (and usable) wiki source.

<techie>
Found it! this call invokes html_insert_softbreaks, which inserts zero-width-spaces because of the following reason:

Chris--S wrote:// its a long string without a breaking character,
// make certain characters into breaking characters by inserting a
// breaking character (zero length space, U+200B / #8203) in front them.

It was introduced in commit fcfecb69832d5532b9c7d5362e4b7bb781c8fa11 by Christopher Smith to fix FS#2676, discussed in https://github.com/splitbrain/dokuwiki/pull/165.
</techie>

Return to Technical