Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
hiddenheader-plugin: problems with section edit, break of span-tags, anchor-rerendering
Page:  1  2  next 
Avatar
Samana Johann #1
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Subject: hiddenheader-plugin: problems with section edit, break of span-tags, anchor-rerendering
Valued Dokuwiki-team and user,

using the hiddenheader plugin it (as far as seen) causes section-edit to make breaks in the middle of closing span tags and then adds a line break, causing the whole html to break if saved.

Furthermore it renders the anchor part of links in a way that "." would be missing in the prased page leading them of course no where specific anymore.

Currently no idea if there would be a fix for long term use.

(topic with links, screen shots here)
Avatar
turnermm (Moderator) #2
Member since Oct 2009 · 4399 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
At the risk of stating the obvious, are you closing your hidden header sections as stated here?
Make sure to end the section, by starting a new section. This can be done with another hidden section, or with an empty section header: ==== ====
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Avatar
Samana Johann #3
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Appreciation Mr. Myron,

There is/are other header-lines between. So my person will try it, thought of the fact that build in combination with include, that sub-headers can be included (and therefore not thought that this might be a reason). If that is the cause of the issue possible only "sectiononly" without sub-headers included would work with "include-plugin. Speculations... let's try. Sadhu!
This post was edited on 2018-10-30, 17:18 by Samana Johann.
Avatar
Samana Johann #4
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Having now changed all into suggested form:

==== header ====

==%hide hide-header ===

...

== ==

==== header ==== ...


all issues remain the same, giving such a section edit for example:

==%hide vin.mv.01 ==

<span sang_id>[[km:tipitaka:vin:mv:vin.mv.01|vin.mv.01]] | [[km:tipitaka:book_006#vin.mv.01|book_006]]</span>
<div centeralign>**ភាគទី ៦**

នមោ តស្ស ភគវតោ អរហតោ សម្មាសម្ពុទ្ធស្ស។

ខ្ញុំសូមនមស្ការ ចំពោះព្រះដ៏មានព្រះភាគ ជាអរហន្តសម្មាសម្ពុទ្ធ ព្រះអង្គនោះ។</div>

<span sang_id>លេខសម្គាល់</span>

<span page_kmt>លេខទំព៍រ</span>

=

Could the appearing of possible similar anchor, that of header and another, cause the problem, by any check like if double... then?
Avatar
Samana Johann #5
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
After disable, after also deinstallation of hidden-header-plugin, the section edit problem is gone so far BUT:

The rerendering/break of anchor/id in link remains now.

An anchor-link like url#vin.mv.01.01 is now -like when 1. using hh-plugin - parsed into url#vinmv0101

(see http://accesstoinsight.eu/km/tipitaka/book_006 ) as sample, under book_006 links, right, small)

What could my person do to solve this matter?
If a bug, or bugs here, it would be good to let the developer know.
Avatar
Michaelsy #6
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
Quote by Samana Johann:
What could my person do to solve this matter?
I think you will probably have to do without the use of the dots.
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
Avatar
Samana Johann #7
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
There was no problem before, worked fine, Mr Michael, and as far as remembering are dots "legal" characters in id's.

Sure, if not given a solution, the suggestion is the natural way.
Avatar
Michaelsy #8
Member since Jun 2015 · 569 posts · Location: Düsseldorf, Germany
Group memberships: Members
Show profile · Link to this post
are dots "legal" characters in id's

In the best of all imaginable worlds that would surely bring no problems to light.
By Patreon.com a few eurons can be fed into the code phasers of
the DokuWiki engine. Besides, Andi's posts are worth reading.
Avatar
Samana Johann #9
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
It's not so, Mr. Michael, that the underlying messages was not got already. Anyway...
The id value must contain at least one character, and must not contain whitespace (spaces, tabs, etc.).
https://www.w3schools.com/html/html_id.asp
Whitespaces, btw, make in regard of parsing no problems.
Avatar
LarsDW223 #10
Member since Sep 2014 · 344 posts · Location: Paderborn
Group memberships: Members
Show profile · Link to this post
There was no problem before, worked fine, Mr Michael, and as far as remembering are dots "legal" characters in id's.

If I understood you right, you deinstalled the hiddenheader plugin but the behaviour is not as before? Did you clear the cache?
Avatar
Samana Johann #11
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Mr. Lars, "?purge=true" was executed with no effects on the issue. Saving in config-manager was made, also with no effects on the issue. Not sure if my person matched all kinds of "clearing cache". Browser-cache (altought not thinking that this could be relevant) was also made.
Avatar
Samana Johann #12
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Not having found any reason or solution, and since it effects sectionheader-links as well, my person thought to share a sample-page on the case.

What ever hints to solve it are appreciated.
Avatar
Krecik #13
Member since Jun 2018 · 5 posts
Group memberships: Members
Show profile · Link to this post
It seems like I have found a very simple quick solution for this problem:

In the file "inc/pageutils.php" under "function sectionID", I changed this line (line 232 in the DokuWiki installation on sangham.net)

$title = str_replace(array(':','.'),'',cleanID($title));

to this:

$title = str_replace(array(':'),'',cleanID($title))

After this change, it seems to work (after editing a page one more time, just changing something small so that the page will be rebuilt in the cache).

I am not sure if maybe some other problems will appear after this change. Maybe there is a good reason why DokuWiki deletes dots from section ids. (It seems all anchors are handled as "section ids", even if they are just anchors put in the middle of the text. They are processed by this function "sectionID", which removes all dots and colons (':' and '.') and does some other things.)

Would be good to know what the reason is for deleting dots from section ids and anchor links, and if it is okay to change the code like this without problems. But it seems this is only a rendering matter. So data would not be lost through this change in the PHP code, even if something strange appears at some point. If something is wrong with this solution then one can simply change the code back to the original and maybe find a better way to deal with the problem.
Avatar
Samana Johann #14
Member since Jun 2018 · 123 posts · Location: Aural/Cambodia
Group memberships: Members
Show profile · Link to this post
Sadhu

PHPXref 0.7 states:
"Creates a XHTML valid linkid from a given headline title"

Not sure about XHTML and dots in anchor or id.

How ever, as a dot might be common in headers (1. ..., 2. ...), and as far as perceived before (that there was no "problem" before hidden-plugin), it seems that there must be two renderings, one for the created link and one for the created ID of headers. Not sure if the possible change by the plugin did not left something in the part of rendering the ID of the title behind.

(the solution might be overwritten when upgrade is made, wouldn't it)
Avatar
Krecik #15
Member since Jun 2018 · 5 posts
Group memberships: Members
Show profile · Link to this post
Quote by Samana Johann:
Not sure about XHTML and dots in anchor or id.

Yes, the same occurred to me. Now I found some info. Reading in the XHTML 1.0 standard under the heading "C.8. Fragment Identifiers":
, since the set of legal values for attributes of type ID is much smaller than for those of type CDATA, the type of the name attribute has been changed to NMTOKEN (link inserted by me: referring to a website in German language). This attribute is constrained such that it can only have the same values as type ID, or as the Name production in XML 1.0 Section 2.3, production 5.

/.../

Note that the collection of legal values in XML 1.0 Section 2.3, production 5 is much larger than that permitted to be used in the ID and NAME types defined in HTML 4. When defining fragment identifiers to be backward-compatible, only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be used.

Looking at the definition of NMTOKEN:
Der lexikalische und der Werteraum von xs:NMTOKEN sind die Mengen von »Namenstoken« nach XML 1.0, d.h. Token, die aus Buchstaben, Ziffern, ».«, »:«, »-« und den von Unicode definierten Zeichen wie zum Beispiel »combining« oder »extender« zusammengesetzt sind.

So the dot '.' (and also colon ':') are both explicitly allowed here in XHTML (and even backwards compatible to HTML 4).

The only problem I could imagine might be in JavaScript, especially jQuery code that could be confused by the dots and colons in 'id' query selectors, because dots normally indicate the beginning of 'class' query selectors. (But in standard JavaScript methods at least there is a workaround to simply escape such dots in id selectors with '\\.' - see https://stackoverflow.com/a/17563341/7048200)
So I guess this was maybe just a measure of extra caution in regards to possible problems with jQuery, maybe without an actual existing case where such might be really necessary.

Quote by Samana Johann:
How ever, as a dot might be common in headers (1. ..., 2. ...), and as far as perceived before (that there was no "problem" before hidden-plugin), it seems that there must be two renderings, one for the created link and one for the created ID of headers. Not sure if the possible change by the plugin did not left something in the part of rendering the ID of the title behind.

As far as I have seen through the code, the same function "sectionID" is used before rendering anchor links and section ids, making the same kind of transformation removing the dots. And the hidden-plugin also does not change this (This is the complete code: https://github.com/zioth/dokuwiki_hiddenheader/blob/master…).
The problem already exists without the hidden plugin in the test DokuWiki that I have installed on my computer. It is simply in the "sectionID" function of DokuWiki.

Quote by Samana Johann:
(the solution might be overwritten when upgrade is made, wouldn't it)

Yes, with upgrade of DokuWiki, but not upgrade of Hidden-Plugin, because the problem is in DokuWiki.

I will try to open an issue in DokuWiki GitHub later and ask why this "sectionID" function removes dots and colons, and if that is really necessary for something. Maybe they come to the conclusion that it is not really needed and change it.

_/\_
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-12-14, 22:49:35 (UTC +01:00)