You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Lukas Theussl (JIRA)" <ji...@codehaus.org> on 2007/07/12 00:32:13 UTC

[jira] Created: (DOXIA-131) HtmlTools.encodeId makes id lower case

HtmlTools.encodeId makes id lower case
--------------------------------------

                 Key: DOXIA-131
                 URL: http://jira.codehaus.org/browse/DOXIA-131
             Project: doxia
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.0-alpha-8
            Reporter: Lukas Theussl


HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (DOXIA-131) HtmlTools.encodeId makes id lower case

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/DOXIA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dennis Lundberg closed DOXIA-131.
---------------------------------

    Resolution: Fixed

> HtmlTools.encodeId makes id lower case
> --------------------------------------
>
>                 Key: DOXIA-131
>                 URL: http://jira.codehaus.org/browse/DOXIA-131
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0-alpha-8
>            Reporter: Lukas Theussl
>            Assignee: Dennis Lundberg
>             Fix For: 1.0-alpha-9
>
>
> HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-131) HtmlTools.encodeId makes id lower case

Posted by "Vincent Siveton (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102045 ] 

Vincent Siveton commented on DOXIA-131:
---------------------------------------

Seems to be a typo: the javadoc is clear! Feel free to correct it with a test case!

Also, the actual test case [1] should be moved to o.a.m.d.util in the src/test dir

[1] 
https://svn.apache.org/repos/asf/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/module/HtmlToolsTest.java

> HtmlTools.encodeId makes id lower case
> --------------------------------------
>
>                 Key: DOXIA-131
>                 URL: http://jira.codehaus.org/browse/DOXIA-131
>             Project: doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0-alpha-8
>            Reporter: Lukas Theussl
>             Fix For: 1.0-beta-1
>
>
> HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-131) HtmlTools.encodeId makes id lower case

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_103870 ] 

Dennis Lundberg commented on DOXIA-131:
---------------------------------------

I have checked the different standards and have not found any evidence that ids need to be lower case. So I added a test case and changed encodeId() to not change case anymore. I also added tons of JavaDoc.

Is that enough or did you have any other documentation in mind, Lukas?

> HtmlTools.encodeId makes id lower case
> --------------------------------------
>
>                 Key: DOXIA-131
>                 URL: http://jira.codehaus.org/browse/DOXIA-131
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0-alpha-8
>            Reporter: Lukas Theussl
>            Assignee: Dennis Lundberg
>             Fix For: 1.0-beta-1
>
>
> HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DOXIA-131) HtmlTools.encodeId makes id lower case

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/DOXIA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukas Theussl updated DOXIA-131:
--------------------------------

    Fix Version/s:     (was: 1.0-beta-1)
                   1.0-alpha-9

See http://mail-archives.apache.org/mod_mbox/maven-doxia-dev/200708.mbox/%3c46C17AAA.6070604@apache.org%3e

> HtmlTools.encodeId makes id lower case
> --------------------------------------
>
>                 Key: DOXIA-131
>                 URL: http://jira.codehaus.org/browse/DOXIA-131
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0-alpha-8
>            Reporter: Lukas Theussl
>            Assignee: Dennis Lundberg
>             Fix For: 1.0-alpha-9
>
>
> HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-131) HtmlTools.encodeId makes id lower case

Posted by "Lukas Theussl (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_102049 ] 

Lukas Theussl commented on DOXIA-131:
-------------------------------------

Hmm, I have a doubt: the apt user guide cites the following example for anchor/link usage:
 {noformat} 
{Anchor}. Link to {{anchor}}. Link to {{{anchor}showing alternate text}}.
 {noformat}
This gets converted by aptconvert into the following html:
 {code:xml}
<a id="anchor" name="anchor">Anchor</a>. Link to <a href="#anchor">Anchor</a>. Link to <a href="#anchor">showing alternate text</a>.
{code}
Note the anchor name and id have become lower case. Now I don't see that documented anywhere in the aptconvert guide (it only states "The name of an anchor/link is its text with all non alphanumeric characters stripped."), and it doesn't seem consistent since id's are case sensitive.

So I'd say we stick to not making id's lower case, but we have to adjust the documentation...


> HtmlTools.encodeId makes id lower case
> --------------------------------------
>
>                 Key: DOXIA-131
>                 URL: http://jira.codehaus.org/browse/DOXIA-131
>             Project: doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0-alpha-8
>            Reporter: Lukas Theussl
>             Fix For: 1.0-beta-1
>
>
> HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-131) HtmlTools.encodeId makes id lower case

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_103941 ] 

Dennis Lundberg commented on DOXIA-131:
---------------------------------------

I had a look at the original docs for aptconvert and found this interesting quote:
{quote}
The name of an anchor/link is its text with all non alphanumeric characters stripped.
{quote}

That suggests that we should be removing these characters ":_.-" from the ids as well.

I'll give aptconvert a spin and see if I can shed some light on these issues.

> HtmlTools.encodeId makes id lower case
> --------------------------------------
>
>                 Key: DOXIA-131
>                 URL: http://jira.codehaus.org/browse/DOXIA-131
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0-alpha-8
>            Reporter: Lukas Theussl
>            Assignee: Dennis Lundberg
>             Fix For: 1.0-beta-1
>
>
> HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DOXIA-131) HtmlTools.encodeId makes id lower case

Posted by "Dennis Lundberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/DOXIA-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_103942 ] 

Dennis Lundberg commented on DOXIA-131:
---------------------------------------

Here are the results of a little test I did with aptconvert

APT
{code}
  {Anchor}. Link to {{Anchor}}. Link to {{http://www.pixware.fr}}. 
  Link to {{{Anchor}showing alternate text}}.
  Link to {{{http://www.pixware.fr}Pixware home page}}.
  {-.:_myAnchor-_.:}
{code}

HTML
{code:xml}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<title></title>
</head>
<body>
<p><a id="anchor" name="anchor">Anchor</a>. Link to
<a href="#anchor">Anchor</a>. Link to
<a href="http://www.pixware.fr">http://www.pixware.fr</a>. Link to
<a href="#anchor">showing alternate text</a>. Link to
<a href="http://www.pixware.fr">Pixware home page</a>.
<a id="myanchor" name="myanchor">-.:_myAnchor-_.:</a></p></body>
</html>
{code}

As you can see characters are converted to lower case and "-_.:" are being stripped away.

I think that preserving case, like we do now, is the right thing to do. If we don't it might lead to duplicate ids which is illegal.

We should probably remove the "-_.:" characters though, as they don't have any value in an id attribute.

> HtmlTools.encodeId makes id lower case
> --------------------------------------
>
>                 Key: DOXIA-131
>                 URL: http://jira.codehaus.org/browse/DOXIA-131
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.0-alpha-8
>            Reporter: Lukas Theussl
>            Assignee: Dennis Lundberg
>             Fix For: 1.0-beta-1
>
>
> HtmlTools.encodeId uses Character.toLowerCase to convert its argument to lower case. I don't see the reason for that since upper case characters are legal in id's (see http://www.w3.org/TR/html4/types.html#type-name ). In particular, it's a problem with anchors/links in the xhtml sink (see DOXIA-47 ), especially if we want to create anchors from section names, to maintain backward compatibility with m1. Is there a special reason for the toLowerCase or can we remove it?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira