issue-#113 XhtmlExporter bug with StdLinks.Target
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
issue-#113 XhtmlExporter bug with StdLinks.Target
This issue deals with the bug reported by Ivan.
The issue is fixed as far as I see it.
I have also added the conversion of StdLinks.Link with the command Dialog.OpenExternal.
Some minor code cleanups have also been applied.
See the diffs at http://redmine.blackboxframework.org/pr ... 80743c8d8a.
The quality of the generated html when applied to our change list is still poor but it is correct html now.
The main quality problem is that links represent a separate paragraph, i.e. they are not embedded in the text.
Improving this would need a good understanding of the paragraph formatting strategy and
possible restrictions imposed by the xhtml format.
- Josef
The issue is fixed as far as I see it.
I have also added the conversion of StdLinks.Link with the command Dialog.OpenExternal.
Some minor code cleanups have also been applied.
See the diffs at http://redmine.blackboxframework.org/pr ... 80743c8d8a.
The quality of the generated html when applied to our change list is still poor but it is correct html now.
The main quality problem is that links represent a separate paragraph, i.e. they are not embedded in the text.
Improving this would need a good understanding of the paragraph formatting strategy and
possible restrictions imposed by the xhtml format.
- Josef
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
Sorry Josef, the result is better but not correct.
The result is written in plain ASCII instead of UTF-8.
- Helmut
The result is written in plain ASCII instead of UTF-8.
- Helmut
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
There has not been any change in character code conversionZinn wrote:Sorry Josef, the result is better but not correct.
The result is written in plain ASCII instead of UTF-8.
- Helmut
and as far as I see there is a Utf-8 conversion.
Can you give an example?
- Josef
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
The 5 steps to produce the error:
1. Copy the 4 lines
2. Paste it into an empty BlackBox document
3. Save this document as XHTML Text (*.html)
4. Click on the save html file
5. It opens in your browser and the 3rd question is unreadable.
Josef, it is right that the error already exist before your changes.
- Helmut
1. Copy the 4 lines
Code: Select all
1 Was ist BlackBox?
2 What is BlackBox?
3 Что такое БлэкБокс?
4 Can you read this 3 questions?
3. Save this document as XHTML Text (*.html)
4. Click on the save html file
5. It opens in your browser and the 3rd question is unreadable.
Code: Select all
[<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/strict.dtd">
<html>
<head>
<title>New Page</title>
</head>
<body>
<p>1 Was ist BlackBox?</p>
<p>2 What is BlackBox?</p>
<p>3 ?</p>
<p>4 Can you read this 3 questions?</p>
</body>
</html>
- Helmut
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
I see. Thanks for the example.
The entity mapping interferes with the Utf-8 conversion.
When I fix that, Chrom displays it correctly but Internet Explorer ignores the Utf-8 encoding specified in the header.
The only way is to use the &#nnnn; notation for extended characters.
This works under Chrome and IE.
With the fix the module XhtmlEntitySets gets much simpler.
See the changes under http://redmine.blackboxframework.org/pr ... 8e80dfbbd9.
Do we need to URL-encode the link for Dialog.OpenExternal?
- Josef
The entity mapping interferes with the Utf-8 conversion.
When I fix that, Chrom displays it correctly but Internet Explorer ignores the Utf-8 encoding specified in the header.
The only way is to use the &#nnnn; notation for extended characters.
This works under Chrome and IE.
With the fix the module XhtmlEntitySets gets much simpler.
See the changes under http://redmine.blackboxframework.org/pr ... 8e80dfbbd9.
Do we need to URL-encode the link for Dialog.OpenExternal?
- Josef
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
Josef, UTF8 is much better. Internet Explorer will not ignore utf8 with the instruction
in header section.
Code: Select all
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
I think, yes.Josef Templ wrote:Do we need to URL-encode the link for Dialog.OpenExternal?
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
I would also prefer UTF-8.Ivan Denisov wrote:Josef, UTF8 is much better. Internet Explorer will not ignore utf8 with the instructionin header section.Code: Select all
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
The output of XhtmlExporter is expected to follow the XHTML standard.
If the meta element is part of that standard it would be a better solution.
- Josef
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
check this patch in procedure XhtmlExporter.ExportText:Ivan Denisov wrote:Josef, UTF8 is much better. Internet Explorer will not ignore utf8 with the instructionin header section.Code: Select all
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
Code: Select all
e.wr.StartTag("head", XhtmlWriters.prettyPrint);
(*add begin*)
e.wr.StartTag("meta", XhtmlWriters.preserve);
e.wr.Attr("http-equiv", "content-type");
e.wr.Attr("content", "text/html; charset=utf-8");
e.wr.EndTag;
(* add end*)
e.wr.StartTag("title", XhtmlWriters.preserve); Dialog.MapString(untitled, str); e.wr.Data(str$); e.wr.EndTag;
luowy
-
- Posts: 1700
- Joined: Tue Sep 17, 2013 12:21 am
- Location: Russia
Re: issue-#113 XhtmlExporter bug with StdLinks.Target
I fond where solo (Dmitriy Solomennikov) posted his fixed version.
http://forum.oberoncore.ru/viewtopic.ph ... tml#p85435
http://forum.oberoncore.ru/viewtopic.ph ... tml#p85435