Bug 56116 - Names of bookmarks should allow all characters which are valid in HTML anchor names (missing: ':' and '.')
Summary: Names of bookmarks should allow all characters which are valid in HTML anchor...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.6.1.2 release
Hardware: All All
: medium enhancement
Assignee: brij
URL:
Whiteboard: BSA target:4.4.0
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2012-10-18 03:05 UTC by Mathias Kinsele
Modified: 2015-12-15 12:07 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Bookmark accepting ':' and '.' after changes (41.69 KB, image/png)
2014-11-15 21:32 UTC, brij
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Kinsele 2012-10-18 03:05:48 UTC
Textmarken dürfen bei der Benennung nicht alle Zeichen enthalten, welche unter HTML für Ankerpunkte möglich sind.
Erforderliche Änderung: Prüfung der Textmarkenbezeichnung.
Comment 1 Roman Eisele 2012-10-25 10:38:09 UTC
Not a BASIC issue (BASIC is the programming/macro language), but a basic Writer problem. → Changed Component accordingly.
Comment 2 Roman Eisele 2012-10-25 10:49:24 UTC
Translation of comment #0:

The names of bookmarks can not contain all characters which are allowed for the names of HTML anchors.

Necessary change: Check bookmark names. [?]
Comment 3 Roman Eisele 2012-10-25 10:59:08 UTC
Thank you for your bug report!

However, please file bug reports for LibreOffice in English language, if possible ;-) This is an international community, and we use English as collaboration language. Translating bug reports from foreign languages costs additional hours of work, which we would prefer to use for checking and confirming the bugs, and it may introduce errors (did I match the sense of your bug report, or ...?)

In addition, we need to put this more precisely. Some questions:

1) Can you please specify which kinds of characters (ranges, or at least
   some examples) are allowed for names of anchors in HTML, but are not
   allowed in the names of bookmarks in LibreOffice?

2) I may miss something, but is it really obvious that LibreOffice (or
   any similar application) needs to support *all* characters for the names
   of bookmarks which are allowed in the names of anchors in HTML format?
   Of course, if LibreOffice was mainly an HTML editor, and was advertised
   as supporting all HTML features you can dream of, this would be
   very plausible, but right now I am not sure if this is really a *bug*
   in LibreOffice. (Where do we declare that we support all of these
   characters in bookmark names?)

No offence! Question 1) is just necessary to understand the problem; please understand that we do not have the time to find out by trial and error what you mean ;-) And question 2) is not an attack on your report; I just want to clarify if this issue is really to be regarded as a *bug* in the strict sense of that word, or if we better turn this into an enhancement request: “Please allow ... characters in bookmark names”. I would suggest the latter ...

Thank you very much for your answers!
Comment 4 Mathias Kinsele 2012-10-25 16:41:10 UTC
I did a test with my german keybord under LO 3.6.2.2 in Windows 7 and used the special characters.
The result: ^°!§$%&()[]{}=ß`´€äöü+'<>|_- are valid characters
            "/?\@*#;:,.                  are invalid characters
                                         in a bookmark's name.
Comment 5 Roman Eisele 2012-10-25 17:20:29 UTC
Thank you very much for checking this!

Now the next question is: which characters are allowed for the names of HTML anchors? AFAIK, HTML anchors are <a> tags with an name="" attribute (or, more up-to-date, with an id="" attribute). According to
    http://www.w3.org/TR/html401/struct/links.html#adef-name-A
the name attribute is of type cdata; this would indeed allow a wide range of characters! But according to
    http://www.w3.org/TR/html401/types.html#type-cdata
the range of allowed charaters especially in the name and id attributes is rather limited:
     ID and NAME tokens must begin with a letter ([A-Za-z])
     and may be followed by any number of letters, digits ([0-9]),
     hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
I would assume that “letters” in “any number of letters” means the same as “letter ([A-Za-z])” before, i.e. an Latin ASCII letter.

So (according to your list) LibreOffice actually allows much *more* characters in bookmark names than HTML in name/id attributes ;-) The only characters which are allowed in HTML name attributes, but not in LibreOffice bookmark names, are
     : .

Therefore, the only characters which need to be allowed additionally in bookmark names to match the whole range of characters which are allowed for the names of HTML anchors are ‘:’ and ‘.’ Would you agree? (Then we could formulate this issue as a very precise enhancement request.)
Comment 6 Mathias Kinsele 2012-10-25 18:54:47 UTC
Yes I agree to just add ';' and '.' to the list of allowed characters for LibreOffice bookmark names.
Comment 7 Roman Eisele 2012-10-27 19:17:51 UTC
Thank you for your answer!

OK, so I suggest we turn this report into an enhancement request (cf. my argument given in comment #3, item 2) and comment).n I have changed the Summary to reflect the kind of the report, adapted the Importance field to “enhancement”, and set the Status field to “NEW”, i.e. CONFIRMED.

Now we just need to wait for a developer who will pick up this issue ...

Thank you again for your report and answers!
Comment 8 brij 2014-11-15 21:14:11 UTC
Hi,

I would like to work on this bug. Kindly provide more details about the files which I can look into to find the code which restricts these characters from being entered in the bookmark textbox.

Thanks!
Comment 9 brij 2014-11-15 21:32:04 UTC
Created attachment 109541 [details]
Bookmark accepting ':' and '.' after changes
Comment 10 brij 2014-11-15 21:42:35 UTC
Hi,

I have made appropriate changes and pushed the patch. Kindly review. Here's the link.

https://gerrit.libreoffice.org/#/c/12466/

Thanks!
Comment 11 Commit Notification 2014-11-16 16:12:13 UTC
Brij Mohan Lal Srivastava committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=82d6ee7ce7576be6e7ef04b5011fda35f5378272

fdo#56116 : Names of bookmarks should allow all characters which

It will be available in 4.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 12 Urmas 2014-11-18 07:26:24 UTC
What clown pushed this without fixing DOC(X) export also?
Comment 13 brij 2014-11-18 07:52:01 UTC
(In reply to Urmas from comment #12)
> What clown pushed this without fixing DOC(X) export also?

Hi Urmas,

I guess you are talking about sw/source/uibase/utlui/content.cxx line:3259

If not, then please let me know how to re-produce the bug. Thanks!
Comment 14 Björn Michaelsen 2014-11-24 08:11:47 UTC
(In reply to Urmas from comment #12)
> What clown pushed this without fixing DOC(X) export also?

Please dont scopecreep bugs. File a new bug for enhancements beyond what this bug asks for. Thanks.
Comment 15 Mike §chinagl 2014-12-20 22:09:26 UTC
This bug fix comes with LibreOffice 4.4 (release notes https://wiki.documentfoundation.org/ReleaseNotes/4.4) 

Bookmarks in Navigator can be named using any character that is accepted in HTML anchor names. Specifically, LibreOffice now accepts . and :.
Comment 16 Robinson Tryon (qubit) 2015-12-15 12:07:44 UTC
Migrating Whiteboard tags to Keywords: ( EasyHack DifficultyBeginner SkillCpp)
[NinjaEdit]