pfumagalli / couldit-autoexport

Automatically exported from code.google.com/p/couldit-autoexport
Other
0 stars 1 forks source link

Bad anchors after in the exported .html files #25

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a new wiki page in Confluence 2.2.10.
2. In this wiki page, write the following wiki code:

{toc}

h1. Test: this is a test.

3. Generate a .html page using the Autoexport plugin.

What is the expected output? What do you see instead?
Expected: A link for the title "Test: this is a test." is generated by
{toc} in the .html page. When you click the link, you go to the "Test: this
is a test." section of the page.

Actual: When you click the link generated by {toc}, you cannot go to the
"Test: this is a test." section of the page. The reason is that in the
title, there is a colon ":". In the generated .html page, the colon in the
link of the {toc} part is changed into something else (in my case, it's
"%252"). However, the colon in the title is changed into a different thing
(in my case, it's "%253").

This causes a problem for me that I have to manually change all the parts
in the .html page where there were colons to make the links in the {toc}
work. It could be a big amount of work.

What version of the product are you using? On what operating system?
using Confluence 2.2.10 on Windows XP.

Please provide any additional information below.
The links with colons in the {toc} do work before they are exported as
.html files, so I think it has something to do with the Autoexport plugin.

Please fix it for me. Thank you! Any questions about the issue, please send
email to me (ltang.ellen@gmail.com).

Original issue reported on code.google.com by ltang.el...@gmail.com on 28 Sep 2009 at 7:43

GoogleCodeExporter commented 9 years ago
Sorry, I have a correction to make here. In my answer to the "What is the 
expected
output? What do you see instead?" question, the following actual output has a 
small
mistake:

"Actual: When you click the link generated by {toc}, you cannot go to the
"Test: this is a test." section of the page. The reason is that in the
title, there is a colon ":". In the generated .html page, the colon in the
link of the {toc} part is changed into something else (in my case, it's
"%252"). However, the colon in the title is changed into a different thing
(in my case, it's "%253")."

The correct actual output should be:

"Actual: When you click the link generated by {toc}, you cannot go to the
"Test: this is a test." section of the page. The reason is that in the
title, there is a colon ":". In the generated .html page, the colon in the
link of the {toc} part is changed into something else (in my case, it's
"%252"). However, the colon in the title is changed into a different thing
(in my case, it's "%2"). This causes that the title of the section doesn't 
match the
link."

Original comment by ltang.el...@gmail.com on 28 Sep 2009 at 8:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I know why this happens. In the link, the colon gets translated to %3A by 
confluence because of URL encoding and then the autoexport converts the % sign 
to %25. The result of the colon is %253A, which is %3A instead of a colon. This 
doesn't happen in the anchor, so there is a mismatch

For example:

The link -

<a href='#Testpage-Intro%253Ahello'>Intro:hello</a></li> 

The anchor -

<h1><a name="Testpage-Intro%3Ahello"></a>Intro:hello</h1> 

Original comment by ulk...@gmail.com on 22 Mar 2011 at 8:58