Andy Little wrote:
Hi ,

In my use of anchors I love to separate-everything-with-hyphens. It seems that
quickbook will preserve the hyphens in an anchor within a document, but convert
them to ( or think they are? ) underscores when creating a link from another
document, thereby flagging an error no constraint for  my-anchor.

I am being very lazy here because I could [link my_anchor my-anchor], but is
there any reason not to leave hyphens as hyphens?

Right. And it's documented. See section Headings for example:
http://boost.org/tools/quickbook/doc/html/quickbook/syntax.html

'''
normalized names with name="section_id.normalized_header_text"
(i.e. valid characters are a-z, A-Z, 0-9 and _. All non-valid
characters are converted to underscore and all upper-case are
converted to lower-case. For example: Heading 1 in section
Section 2 will be normalized to section_2.heading_1)
'''

This might be too conservative (only C identifiers are allowed),
and the reason is simplification. I did not want to bother with
having to find the "universal" URL, link, etc, that would work
for all. I figured C identifiers are acceptable almost everywhere.
It's quite easy to change the behavior if it can be shown to be
safe for all output formats including HTML, PDF etc. The relevant
code is just:

    char
    filter_identifier_char(char ch)
    {
        if (!std::isalnum(static_cast<unsigned char>(ch)))
            ch = '_';
        return static_cast<char>(
            std::tolower(static_cast<unsigned char>(ch)));
    }

Comments?

Regards,
--
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests: 
https://lists.sourceforge.net/lists/listinfo/boost-docs

Reply via email to