issue-#113 XhtmlExporter bug with StdLinks.Target

Post Reply
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Josef Templ »

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
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Zinn »

Sorry Josef, the result is better but not correct.
The result is written in plain ASCII instead of UTF-8.
- Helmut
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Josef Templ »

Zinn wrote:Sorry Josef, the result is better but not correct.
The result is written in plain ASCII instead of UTF-8.
- Helmut
There has not been any change in character code conversion
and as far as I see there is a Utf-8 conversion.

Can you give an example?

- Josef
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Zinn »

The 5 steps to produce the error:
1. Copy the 4 lines

Code: Select all

1 Was ist BlackBox? 		
2 What is BlackBox? 		
3 Что такое БлэкБокс? 		
4 Can you read this 3 questions?
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.

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>
Josef, it is right that the error already exist before your changes.
- Helmut
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Josef Templ »

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
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Ivan Denisov »

Josef, UTF8 is much better. Internet Explorer will not ignore utf8 with the instruction

Code: Select all

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
in header section.
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Ivan Denisov »

Josef Templ wrote:Do we need to URL-encode the link for Dialog.OpenExternal?
I think, yes.
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Josef Templ »

Ivan Denisov wrote:Josef, UTF8 is much better. Internet Explorer will not ignore utf8 with the instruction

Code: Select all

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
in header section.
I would also prefer 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
luowy
Posts: 234
Joined: Mon Oct 20, 2014 12:52 pm

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by luowy »

Ivan Denisov wrote:Josef, UTF8 is much better. Internet Explorer will not ignore utf8 with the instruction

Code: Select all

<meta http-equiv="content-type" content="text/html; charset=UTF-8">
in header section.
check this patch in procedure XhtmlExporter.ExportText:

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;
which did by "20140117, solo, added meta tag to exported file with content type set."

luowy
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#113 XhtmlExporter bug with StdLinks.Target

Post by Ivan Denisov »

I fond where solo (Dmitriy Solomennikov) posted his fixed version.
http://forum.oberoncore.ru/viewtopic.ph ... tml#p85435
Post Reply