* Valid XHTML
@ 2008-10-31 19:54 Sebastian Rose
2008-10-26 21:44 ` Sebastian Rose
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Sebastian Rose @ 2008-10-31 19:54 UTC (permalink / raw)
To: [emacs-orgmode]
[-- Attachment #1: Type: text/plain, Size: 2313 bytes --]
Hi,
I'm currently writing a fulltext search engine for Org's
XHTML export.
Export is not valid XHTML:
1.) CDATA:
<style type="text/css">
.... styles ....
</style>
should be:
<style type="text/css">
<![CDATA[
.... styles ....
]]>
</style>
Fix appended:
- patch-missing-cdata-style.patch (org-exp.el)
2.) Missing quotes:
<link rel=stylesheet href="stylesheet.css" type="text/css" />
should be:
<link rel="stylesheet" href="stylesheet.css" type="text/css" />
My fault. I copied and pasted.
Fixes appended:
- patch-stylesheet-missing-quotes.patch (org-publish.el, doc strings)
- patch-stylesheet-missing-quotes-texi.patch (org.texi)
4.) missing entities in link texts (not the URL):
<a
href="http://xy.com/foo.php?f=1&t=bar">http://xy.com/foo.php?f=1&t=bar</a>
should be:
<a
href="http://xy.com/foo.php?f=1&t=bar">http://xy.com/foo.php?f=1&t=bar</a>
Not shure how to this in org-exp.el, org-export-as-html - is there a
function I should use?
5.) index file is not well-formed XML:
sitemap.html:291: parser error : Opening and ending tag mismatch:
body line 43 and div
</div>
^
sitemap.html:297: parser error : Opening and ending tag mismatch:
html line 3 and body
</div></body>
^
sitemap.html:298: parser error : Extra content at the end of the document
</html>
^
Seems there is one '</div>' too much.
It's the </div> directly after the </ul> (never opened after title)
Two possible fixes:
<h1 id="title">Sitemap</h1>
<div> /* <- either insert this one */
<ul>
...
</ul>
</div> /* <- or delete this one */
Last but not least, a general question:
* Problem with xmllint:
Not defined entities:
- …
- —
- mayby more
Not shure, how to fix this.
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
already includes these:
http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
But:
xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
index.html
gives me lots of errors for not defined enities.
Regards,
Sebastian
[-- Attachment #2: patch-stylesheets-missing-quotes.patch --]
[-- Type: text/x-patch, Size: 946 bytes --]
diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index e0cf4bd..db09e17 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -75,4 +75,4 @@
;; :with-section-numbers nil
;; :table-of-contents nil
;; :recursive t
-;; :style "<link rel=stylesheet href=\"../other/mystyle.css\" type=\"text/css\">")))
+;; :style "<link rel=\"stylesheet\" href=\"../other/mystyle.css\" type=\"text/css\">")))
;;;; More complex example configuration:
@@ -103,7 +103,7 @@
;; :headline-levels 3
;; :with-section-numbers nil
;; :table-of-contents nil
-;; :style "<link rel=stylesheet href=\"../other/mystyle.css\" type=\"text/css\">"
+;; :style "<link rel=\"stylesheet\" href=\"../other/mystyle.css\" type=\"text/css\">"
;; :auto-preamble t
;; :auto-postamble nil)
;; ("images" :base-directory "~/images/"
[-- Attachment #3: patch-stylesheets-missing-quotes-texi.patch --]
[-- Type: text/x-patch, Size: 846 bytes --]
diff --git a/doc/org.texi b/doc/org.texi
index b675d92..b623b3e 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -8212,7 +8212,7 @@ directory on the local machine.
:publishing-directory "~/public_html"
:section-numbers nil
:table-of-contents nil
- :style "<link rel=stylesheet
+ :style "<link rel=\"stylesheet\"
href=\"../other/mystyle.css\"
type=\"text/css\">")))
@end lisp
@@ -8249,7 +8249,7 @@ right place on the web server, and publishing images to it.
:headline-levels 3
:section-numbers nil
:table-of-contents nil
- :style "<link rel=stylesheet
+ :style "<link rel=\"stylesheet\"
href=\"../other/mystyle.css\" type=\"text/css\">"
:auto-preamble t
:auto-postamble nil)
[-- Attachment #4: patch-missing-cdata.patch --]
[-- Type: text/x-patch, Size: 1171 bytes --]
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index e680be0..ac59bab 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -492,6 +492,7 @@ Org-mode file."
(defconst org-export-html-style-default
"<style type=\"text/css\">
+ <![CDATA[
html { font-family: Times, serif; font-size: 12pt; }
.title { text-align: center; }
.todo { color: red; }
@@ -518,7 +519,7 @@ Org-mode file."
white-space:nowrap; }
.org-info-js_search-highlight {background-color:#ffff00; color:#000000;
font-weight:bold; }
-
+ ]]>
</style>"
"The default style specification for exported HTML files.
Please use the variables `org-export-html-style' and
@@ -547,11 +548,13 @@ you should consider to include definitions for the following classes:
For example, a valid value would be:
<style type=\"text/css\">
+ <![CDATA[
p { font-weight: normal; color: gray; }
h1 { color: black; }
.title { text-align: center; }
.todo, .timestamp-kwd { color: red; }
.done { color: green; }
+ ]]>
</style>
If you'd like to refer to en external style file, use something like
[-- Attachment #5: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-31 19:54 Valid XHTML Sebastian Rose
@ 2008-10-26 21:44 ` Sebastian Rose
2008-10-26 22:04 ` Sebastian Rose
` (3 more replies)
2008-11-02 6:50 ` Carsten Dominik
2008-11-03 11:08 ` Carsten Dominik
2 siblings, 4 replies; 13+ messages in thread
From: Sebastian Rose @ 2008-10-26 21:44 UTC (permalink / raw)
To: [emacs-orgmode]
The entities errors go away, if the rest of the file is valid.
Sebastian Rose wrote:
> Last but not least, a general question:
>
> * Problem with xmllint:
>
> Not defined entities:
>
> - …
> - —
> - mayby more
>
> Not shure, how to fix this.
>
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> already includes these:
>
> http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
> http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
> http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
>
>
> But:
>
> xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> index.html
>
> gives me lots of errors for not defined enities.
But one more:
To be valid, this link here:
<a href="x.php?a=b&c=d">x.php?a=b&c=d</a>
should be:
<a href="x.php%3Fa%3Db%26c%3Dd">x.php?a=b&c=d</a>
^ ^
urlencoded--------' entities--'
Regards,
Sebastian
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-26 21:44 ` Sebastian Rose
@ 2008-10-26 22:04 ` Sebastian Rose
2008-10-26 22:12 ` Sebastian Rose
` (2 subsequent siblings)
3 siblings, 0 replies; 13+ messages in thread
From: Sebastian Rose @ 2008-10-26 22:04 UTC (permalink / raw)
To: [emacs-orgmode]
I Hope this is the rest of all possible errors :-)
index.html:583: element p: validity error : Element pre is not declared
in p list of possible children
index.html:583: element p: validity error : Element pre is not declared
in p list of possible children
index.html:826: element p: validity error : Element hr is not declared
in p list of possible children
index.html:1406: element p: validity error : Element u is not declared
in p list of possible children
index.html:1407: element u: validity error : No declaration for element u
index.html:1448: element p: validity error : Element pre is not declared
in p list of possible children
index.html:1458: element p: validity error : Element pre is not declared
in p list of possible children
index.html:1756: element p: validity error : Element pre is not declared
in p list of possible children
index.html:1761: element p: validity error : Element pre is not declared
in p list of possible children
Document index.html does not validate against
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
Means:
<pre> is not allowed inside <p>
and there is no <u> element in xhtml1-strict. Oha - never heard that,
but it's true. I scanned
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
Sebastian
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-26 21:44 ` Sebastian Rose
2008-10-26 22:04 ` Sebastian Rose
@ 2008-10-26 22:12 ` Sebastian Rose
2008-10-27 1:25 ` Sebastian Rose
2008-11-02 6:42 ` Carsten Dominik
2008-10-27 0:55 ` Sebastian Rose
2008-10-27 1:45 ` Sebastian Rose
3 siblings, 2 replies; 13+ messages in thread
From: Sebastian Rose @ 2008-10-26 22:12 UTC (permalink / raw)
To: [emacs-orgmode]
No <u> element in XHTML strict.
Would this fix it? I couldn't find <u> somwhere else, so I think this
should work. But it might be the wrong place to fix it...
diff --git a/lisp/org.el b/lisp/org.el
index 00d635b..6b17562 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -2264,7 +2264,7 @@ Use customize to modify this, or restart Emacs
after changing it."
(defcustom org-emphasis-alist
`(("*" bold "<b>" "</b>")
("/" italic "<i>" "</i>")
- ("_" underline "<u>" "</u>")
+ ("_" underline "<span style=\"text-decoration:underline;\">" "</span>")
("=" org-code "<code>" "</code>" verbatim)
("~" org-verbatim "<code>" "</code>" verbatim)
("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))
Regards,
Sebastian
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-26 22:12 ` Sebastian Rose
@ 2008-10-27 1:25 ` Sebastian Rose
2008-11-02 6:42 ` Carsten Dominik
1 sibling, 0 replies; 13+ messages in thread
From: Sebastian Rose @ 2008-10-27 1:25 UTC (permalink / raw)
Cc: [emacs-orgmode]
OK, works here for XHTML and LaTeX.
Regards,
Sebastian
Sebastian Rose wrote:
> No <u> element in XHTML strict.
>
>
> Would this fix it? I couldn't find <u> somwhere else, so I think this
> should work. But it might be the wrong place to fix it...
>
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 00d635b..6b17562 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -2264,7 +2264,7 @@ Use customize to modify this, or restart Emacs
> after changing it."
> (defcustom org-emphasis-alist
> `(("*" bold "<b>" "</b>")
> ("/" italic "<i>" "</i>")
> - ("_" underline "<u>" "</u>")
> + ("_" underline "<span style=\"text-decoration:underline;\">"
> "</span>")
> ("=" org-code "<code>" "</code>" verbatim)
> ("~" org-verbatim "<code>" "</code>" verbatim)
> ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))
>
>
>
> Regards,
>
>
> Sebastian
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-26 22:12 ` Sebastian Rose
2008-10-27 1:25 ` Sebastian Rose
@ 2008-11-02 6:42 ` Carsten Dominik
1 sibling, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2008-11-02 6:42 UTC (permalink / raw)
To: sebastian_rose; +Cc: [emacs-orgmode]
Applied, thanks.
- Carsten
On Oct 26, 2008, at 11:12 PM, Sebastian Rose wrote:
> No <u> element in XHTML strict.
>
>
> Would this fix it? I couldn't find <u> somwhere else, so I think this
> should work. But it might be the wrong place to fix it...
>
>
> diff --git a/lisp/org.el b/lisp/org.el
> index 00d635b..6b17562 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -2264,7 +2264,7 @@ Use customize to modify this, or restart Emacs
> after changing it."
> (defcustom org-emphasis-alist
> `(("*" bold "<b>" "</b>")
> ("/" italic "<i>" "</i>")
> - ("_" underline "<u>" "</u>")
> + ("_" underline "<span style=\"text-decoration:underline;\">" "</
> span>")
> ("=" org-code "<code>" "</code>" verbatim)
> ("~" org-verbatim "<code>" "</code>" verbatim)
> ("+" ,(if (featurep 'xemacs) 'org-table '(:strike-through t))
>
>
>
> Regards,
>
>
> Sebastian
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-26 21:44 ` Sebastian Rose
2008-10-26 22:04 ` Sebastian Rose
2008-10-26 22:12 ` Sebastian Rose
@ 2008-10-27 0:55 ` Sebastian Rose
2008-10-27 2:37 ` Sebastian Rose
2008-11-02 6:40 ` Carsten Dominik
2008-10-27 1:45 ` Sebastian Rose
3 siblings, 2 replies; 13+ messages in thread
From: Sebastian Rose @ 2008-10-27 0:55 UTC (permalink / raw)
To: [emacs-orgmode]
[-- Attachment #1: Type: text/plain, Size: 639 bytes --]
Hi,
1.) ERR
SSTOOOP!!!
Sebastian Rose wrote:
> <a href="x.php%3Fa%3Db%26c%3Dd">x.php?a=b&c=d</a>
> ^ ^
> urlencoded--------' entities--'
Sorry, that's bullsh... This is one of the errors, that goes away, if
<a href="x.php?a=b&c=d">x.php?a=b&c=d</a>
^
entities--'
2.) Fix for 'no <pre> in <p> (XHTML)':
The appended patch fixes this. Don't know if it is correct, but I
tested repeatedly with various files and it seems OK. No empty <p>
elements remain.
Regards,
Sebastian
[-- Attachment #2: patch-no-pre-in-p.patch --]
[-- Type: text/x-patch, Size: 1003 bytes --]
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 4153554..8762843 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -3102,6 +3102,7 @@ lang=\"%s\" xml:lang=\"%s\">
(string-match "^[ \t]*:\\(.*\\)" line))
(when (not infixed)
(setq infixed t)
+ (org-close-par-maybe)
(insert "<pre class=\"example\">\n"))
(insert (org-html-protect (match-string 1 line)) "\n")
(when (or (not lines)
@@ -3339,6 +3340,7 @@ lang=\"%s\" xml:lang=\"%s\">
head-count)
;; QUOTES
(when (string-match quote-re line)
+ (org-close-par-maybe)
(insert "<pre>")
(setq inquote t)))
@@ -3449,7 +3451,7 @@ lang=\"%s\" xml:lang=\"%s\">
(insert line "\n")))))
;; Properly close all local lists and other lists
- (when inquote (insert "</pre>\n"))
+ (when inquote (insert "</pre>\n") (org-open-par))
(when in-local-list
;; Close any local lists before inserting a new header line
(while local-list-type
[-- Attachment #3: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-27 0:55 ` Sebastian Rose
@ 2008-10-27 2:37 ` Sebastian Rose
2008-11-02 6:40 ` Carsten Dominik
1 sibling, 0 replies; 13+ messages in thread
From: Sebastian Rose @ 2008-10-27 2:37 UTC (permalink / raw)
To: [emacs-orgmode]
OK. Investigated a little more about valid links in XHTML.
This here
<a href="xy.php?a=b&c=d">xy.php?a=b&c=d</a>
should be
<a href="xy.php?a=b&c=d">xy.php?a=b&c=d</a>
!!!
These way the links work in browsers AND parsers. We need entities in
link-URLs AND description to have valid XHTML!
Regards,
Sebastian
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-27 0:55 ` Sebastian Rose
2008-10-27 2:37 ` Sebastian Rose
@ 2008-11-02 6:40 ` Carsten Dominik
1 sibling, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2008-11-02 6:40 UTC (permalink / raw)
To: sebastian_rose; +Cc: [emacs-orgmode]
Applied, thanks.
- Carsten
On Oct 27, 2008, at 1:55 AM, Sebastian Rose wrote:
> Hi,
>
>
>
> 1.) ERR
>
> SSTOOOP!!!
>
> Sebastian Rose wrote:
>> <a href="x.php%3Fa%3Db%26c%3Dd">x.php?a=b&c=d</a>
>> ^ ^
>> urlencoded--------' entities--'
>
>
> Sorry, that's bullsh... This is one of the errors, that goes away, if
>
>
> <a href="x.php?a=b&c=d">x.php?a=b&c=d</a>
> ^
> entities--'
>
>
>
> 2.) Fix for 'no <pre> in <p> (XHTML)':
>
> The appended patch fixes this. Don't know if it is correct, but I
> tested repeatedly with various files and it seems OK. No empty <p>
> elements remain.
>
>
>
>
> Regards,
>
> Sebastian
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index 4153554..8762843 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -3102,6 +3102,7 @@ lang=\"%s\" xml:lang=\"%s\">
> (string-match "^[ \t]*:\\(.*\\)" line))
> (when (not infixed)
> (setq infixed t)
> + (org-close-par-maybe)
> (insert "<pre class=\"example\">\n"))
> (insert (org-html-protect (match-string 1 line)) "\n")
> (when (or (not lines)
> @@ -3339,6 +3340,7 @@ lang=\"%s\" xml:lang=\"%s\">
> head-count)
> ;; QUOTES
> (when (string-match quote-re line)
> + (org-close-par-maybe)
> (insert "<pre>")
> (setq inquote t)))
>
> @@ -3449,7 +3451,7 @@ lang=\"%s\" xml:lang=\"%s\">
> (insert line "\n")))))
>
> ;; Properly close all local lists and other lists
> - (when inquote (insert "</pre>\n"))
> + (when inquote (insert "</pre>\n") (org-open-par))
> (when in-local-list
> ;; Close any local lists before inserting a new header line
> (while local-list-type
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-26 21:44 ` Sebastian Rose
` (2 preceding siblings ...)
2008-10-27 0:55 ` Sebastian Rose
@ 2008-10-27 1:45 ` Sebastian Rose
2008-11-02 6:43 ` Carsten Dominik
3 siblings, 1 reply; 13+ messages in thread
From: Sebastian Rose @ 2008-10-27 1:45 UTC (permalink / raw)
To: sebastian_rose; +Cc: [emacs-orgmode]
[-- Attachment #1: Type: text/plain, Size: 163 bytes --]
The appended patch fixes the parsing-error for the index-file.
sh> xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
sitemap.html
no erros
[-- Attachment #2: patch-sitemap-unclosed-diff.patch --]
[-- Type: text/x-patch, Size: 495 bytes --]
diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index c46aedb..58df822 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -626,7 +626,7 @@ Default for INDEX-FILENAME is 'index.org'."
(if index-buffer
(kill-buffer index-buffer))
(with-temp-buffer
- (insert (concat index-title "\n\n"))
+ (insert (concat "* " index-title "\n\n"))
(while (setq file (pop files))
(let ((fn (file-name-nondirectory file))
(link (file-relative-name file dir))
[-- Attachment #3: Type: text/plain, Size: 204 bytes --]
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-27 1:45 ` Sebastian Rose
@ 2008-11-02 6:43 ` Carsten Dominik
0 siblings, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2008-11-02 6:43 UTC (permalink / raw)
To: sebastian_rose; +Cc: [emacs-orgmode]
Applied, thanks.
- Carsten
On Oct 27, 2008, at 2:45 AM, Sebastian Rose wrote:
> The appended patch fixes the parsing-error for the index-file.
>
>
>
> sh> xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> sitemap.html
>
> no erros
> diff --git a/lisp/org-publish.el b/lisp/org-publish.el
> index c46aedb..58df822 100644
> --- a/lisp/org-publish.el
> +++ b/lisp/org-publish.el
> @@ -626,7 +626,7 @@ Default for INDEX-FILENAME is 'index.org'."
> (if index-buffer
> (kill-buffer index-buffer))
> (with-temp-buffer
> - (insert (concat index-title "\n\n"))
> + (insert (concat "* " index-title "\n\n"))
> (while (setq file (pop files))
> (let ((fn (file-name-nondirectory file))
> (link (file-relative-name file dir))
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-31 19:54 Valid XHTML Sebastian Rose
2008-10-26 21:44 ` Sebastian Rose
@ 2008-11-02 6:50 ` Carsten Dominik
2008-11-03 11:08 ` Carsten Dominik
2 siblings, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2008-11-02 6:50 UTC (permalink / raw)
To: sebastian_rose; +Cc: [emacs-orgmode]
Hi Sebastian,
of this email I have now applied the "stylesheet" fixes.
Are you sure about the CDATA patch? Is that not something that is
Javascript-specific? Will this break in oder browsers? Are you
telling me that any inline css style should be wrapped by this strange
thing? Please confirm, and maybe explain a bit more. Thanks.
On Oct 31, 2008, at 8:54 PM, Sebastian Rose wrote:
> Hi,
>
> I'm currently writing a fulltext search engine for Org's
> XHTML export.
>
> Export is not valid XHTML:
>
>
>
> 1.) CDATA:
>
> <style type="text/css">
> .... styles ....
> </style>
>
> should be:
>
> <style type="text/css">
> <![CDATA[
> .... styles ....
> ]]>
> </style>
>
> Fix appended:
>
> - patch-missing-cdata-style.patch (org-exp.el)
>
>
>
> 2.) Missing quotes:
>
> <link rel=stylesheet href="stylesheet.css" type="text/css" />
>
> should be:
>
> <link rel="stylesheet" href="stylesheet.css" type="text/css" />
>
>
> My fault. I copied and pasted.
>
> Fixes appended:
> - patch-stylesheet-missing-quotes.patch (org-publish.el, doc
> strings)
> - patch-stylesheet-missing-quotes-texi.patch (org.texi)
>
>
>
>
> 4.) missing entities in link texts (not the URL):
>
> <a href="http://xy.com/foo.php?f=1&t=bar">http://xy.com/foo.php?f=1&t=bar
> </a>
>
> should be:
>
> <a href="http://xy.com/foo.php?f=1&t=bar">http://xy.com/foo.php?f=1&t=bar
> </a>
>
>
> Not shure how to this in org-exp.el, org-export-as-html - is there a
> function I should use?
>
>
>
>
>
> 5.) index file is not well-formed XML:
>
> sitemap.html:291: parser error : Opening and ending tag mismatch:
> body line 43 and div
> </div>
> ^
> sitemap.html:297: parser error : Opening and ending tag mismatch:
> html line 3 and body
> </div></body>
> ^
> sitemap.html:298: parser error : Extra content at the end of the
> document
> </html>
> ^
>
> Seems there is one '</div>' too much.
>
> It's the </div> directly after the </ul> (never opened after title)
>
> Two possible fixes:
>
> <h1 id="title">Sitemap</h1>
> <div> /* <- either insert this one */
> <ul>
> ...
> </ul>
> </div> /* <- or delete this one */
>
>
>
>
>
>
>
> Last but not least, a general question:
>
> * Problem with xmllint:
>
> Not defined entities:
>
> - …
> - —
> - mayby more
>
> Not shure, how to fix this.
>
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> already includes these:
>
> http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
> http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
> http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
>
>
> But:
>
> xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-
> strict.dtd index.html
>
> gives me lots of errors for not defined enities.
>
>
>
> Regards,
>
> Sebastian
> diff --git a/lisp/org-publish.el b/lisp/org-publish.el
> index e0cf4bd..db09e17 100644
> --- a/lisp/org-publish.el
> +++ b/lisp/org-publish.el
> @@ -75,4 +75,4 @@
> ;; :with-section-numbers nil
> ;; :table-of-contents nil
> ;; :recursive t
> -;; :style "<link rel=stylesheet href=\"../other/mystyle.css
> \" type=\"text/css\">")))
> +;; :style "<link rel=\"stylesheet\" href=\"../other/
> mystyle.css\" type=\"text/css\">")))
>
> ;;;; More complex example configuration:
>
> @@ -103,7 +103,7 @@
> ;; :headline-levels 3
> ;; :with-section-numbers nil
> ;; :table-of-contents nil
> -;; :style "<link rel=stylesheet href=\"../other/mystyle.css
> \" type=\"text/css\">"
> +;; :style "<link rel=\"stylesheet\" href=\"../other/
> mystyle.css\" type=\"text/css\">"
> ;; :auto-preamble t
> ;; :auto-postamble nil)
> ;; ("images" :base-directory "~/images/"
> diff --git a/doc/org.texi b/doc/org.texi
> index b675d92..b623b3e 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -8212,7 +8212,7 @@ directory on the local machine.
> :publishing-directory "~/public_html"
> :section-numbers nil
> :table-of-contents nil
> - :style "<link rel=stylesheet
> + :style "<link rel=\"stylesheet\"
> href=\"../other/mystyle.css\"
> type=\"text/css\">")))
> @end lisp
> @@ -8249,7 +8249,7 @@ right place on the web server, and publishing
> images to it.
> :headline-levels 3
> :section-numbers nil
> :table-of-contents nil
> - :style "<link rel=stylesheet
> + :style "<link rel=\"stylesheet\"
> href=\"../other/mystyle.css\" type=\"text/css\">"
> :auto-preamble t
> :auto-postamble nil)
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index e680be0..ac59bab 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -492,6 +492,7 @@ Org-mode file."
>
> (defconst org-export-html-style-default
> "<style type=\"text/css\">
> + <![CDATA[
> html { font-family: Times, serif; font-size: 12pt; }
> .title { text-align: center; }
> .todo { color: red; }
> @@ -518,7 +519,7 @@ Org-mode file."
> white-space:nowrap; }
> .org-info-js_search-highlight {background-color:#ffff00;
> color:#000000;
> font-weight:bold; }
> -
> + ]]>
> </style>"
> "The default style specification for exported HTML files.
> Please use the variables `org-export-html-style' and
> @@ -547,11 +548,13 @@ you should consider to include definitions for
> the following classes:
> For example, a valid value would be:
>
> <style type=\"text/css\">
> + <![CDATA[
> p { font-weight: normal; color: gray; }
> h1 { color: black; }
> .title { text-align: center; }
> .todo, .timestamp-kwd { color: red; }
> .done { color: green; }
> + ]]>
> </style>
>
> If you'd like to refer to en external style file, use something like
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Valid XHTML
2008-10-31 19:54 Valid XHTML Sebastian Rose
2008-10-26 21:44 ` Sebastian Rose
2008-11-02 6:50 ` Carsten Dominik
@ 2008-11-03 11:08 ` Carsten Dominik
2 siblings, 0 replies; 13+ messages in thread
From: Carsten Dominik @ 2008-11-03 11:08 UTC (permalink / raw)
To: sebastian_rose; +Cc: [emacs-orgmode]
Hi Sebastian,
I believe these are all fixed now. Please confirm.
- Carsten
On Oct 31, 2008, at 8:54 PM, Sebastian Rose wrote:
> Hi,
>
> I'm currently writing a fulltext search engine for Org's
> XHTML export.
>
> Export is not valid XHTML:
>
>
>
> 1.) CDATA:
>
> <style type="text/css">
> .... styles ....
> </style>
>
> should be:
>
> <style type="text/css">
> <![CDATA[
> .... styles ....
> ]]>
> </style>
>
> Fix appended:
>
> - patch-missing-cdata-style.patch (org-exp.el)
>
>
>
> 2.) Missing quotes:
>
> <link rel=stylesheet href="stylesheet.css" type="text/css" />
>
> should be:
>
> <link rel="stylesheet" href="stylesheet.css" type="text/css" />
>
>
> My fault. I copied and pasted.
>
> Fixes appended:
> - patch-stylesheet-missing-quotes.patch (org-publish.el, doc
> strings)
> - patch-stylesheet-missing-quotes-texi.patch (org.texi)
>
>
>
>
> 4.) missing entities in link texts (not the URL):
>
> <a href="http://xy.com/foo.php?f=1&t=bar">http://xy.com/foo.php?f=1&t=bar
> </a>
>
> should be:
>
> <a href="http://xy.com/foo.php?f=1&t=bar">http://xy.com/foo.php?f=1&t=bar
> </a>
>
>
> Not shure how to this in org-exp.el, org-export-as-html - is there a
> function I should use?
>
>
>
>
>
> 5.) index file is not well-formed XML:
>
> sitemap.html:291: parser error : Opening and ending tag mismatch:
> body line 43 and div
> </div>
> ^
> sitemap.html:297: parser error : Opening and ending tag mismatch:
> html line 3 and body
> </div></body>
> ^
> sitemap.html:298: parser error : Extra content at the end of the
> document
> </html>
> ^
>
> Seems there is one '</div>' too much.
>
> It's the </div> directly after the </ul> (never opened after title)
>
> Two possible fixes:
>
> <h1 id="title">Sitemap</h1>
> <div> /* <- either insert this one */
> <ul>
> ...
> </ul>
> </div> /* <- or delete this one */
>
>
>
>
>
>
>
> Last but not least, a general question:
>
> * Problem with xmllint:
>
> Not defined entities:
>
> - …
> - —
> - mayby more
>
> Not shure, how to fix this.
>
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> already includes these:
>
> http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
> http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
> http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
>
>
> But:
>
> xmllint --dtdvalid http://www.w3.org/TR/xhtml1/DTD/xhtml1-
> strict.dtd index.html
>
> gives me lots of errors for not defined enities.
>
>
>
> Regards,
>
> Sebastian
> diff --git a/lisp/org-publish.el b/lisp/org-publish.el
> index e0cf4bd..db09e17 100644
> --- a/lisp/org-publish.el
> +++ b/lisp/org-publish.el
> @@ -75,4 +75,4 @@
> ;; :with-section-numbers nil
> ;; :table-of-contents nil
> ;; :recursive t
> -;; :style "<link rel=stylesheet href=\"../other/mystyle.css
> \" type=\"text/css\">")))
> +;; :style "<link rel=\"stylesheet\" href=\"../other/
> mystyle.css\" type=\"text/css\">")))
>
> ;;;; More complex example configuration:
>
> @@ -103,7 +103,7 @@
> ;; :headline-levels 3
> ;; :with-section-numbers nil
> ;; :table-of-contents nil
> -;; :style "<link rel=stylesheet href=\"../other/mystyle.css
> \" type=\"text/css\">"
> +;; :style "<link rel=\"stylesheet\" href=\"../other/
> mystyle.css\" type=\"text/css\">"
> ;; :auto-preamble t
> ;; :auto-postamble nil)
> ;; ("images" :base-directory "~/images/"
> diff --git a/doc/org.texi b/doc/org.texi
> index b675d92..b623b3e 100644
> --- a/doc/org.texi
> +++ b/doc/org.texi
> @@ -8212,7 +8212,7 @@ directory on the local machine.
> :publishing-directory "~/public_html"
> :section-numbers nil
> :table-of-contents nil
> - :style "<link rel=stylesheet
> + :style "<link rel=\"stylesheet\"
> href=\"../other/mystyle.css\"
> type=\"text/css\">")))
> @end lisp
> @@ -8249,7 +8249,7 @@ right place on the web server, and publishing
> images to it.
> :headline-levels 3
> :section-numbers nil
> :table-of-contents nil
> - :style "<link rel=stylesheet
> + :style "<link rel=\"stylesheet\"
> href=\"../other/mystyle.css\" type=\"text/css\">"
> :auto-preamble t
> :auto-postamble nil)
> diff --git a/lisp/org-exp.el b/lisp/org-exp.el
> index e680be0..ac59bab 100644
> --- a/lisp/org-exp.el
> +++ b/lisp/org-exp.el
> @@ -492,6 +492,7 @@ Org-mode file."
>
> (defconst org-export-html-style-default
> "<style type=\"text/css\">
> + <![CDATA[
> html { font-family: Times, serif; font-size: 12pt; }
> .title { text-align: center; }
> .todo { color: red; }
> @@ -518,7 +519,7 @@ Org-mode file."
> white-space:nowrap; }
> .org-info-js_search-highlight {background-color:#ffff00;
> color:#000000;
> font-weight:bold; }
> -
> + ]]>
> </style>"
> "The default style specification for exported HTML files.
> Please use the variables `org-export-html-style' and
> @@ -547,11 +548,13 @@ you should consider to include definitions for
> the following classes:
> For example, a valid value would be:
>
> <style type=\"text/css\">
> + <![CDATA[
> p { font-weight: normal; color: gray; }
> h1 { color: black; }
> .title { text-align: center; }
> .todo, .timestamp-kwd { color: red; }
> .done { color: green; }
> + ]]>
> </style>
>
> If you'd like to refer to en external style file, use something like
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2008-11-03 11:08 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-31 19:54 Valid XHTML Sebastian Rose
2008-10-26 21:44 ` Sebastian Rose
2008-10-26 22:04 ` Sebastian Rose
2008-10-26 22:12 ` Sebastian Rose
2008-10-27 1:25 ` Sebastian Rose
2008-11-02 6:42 ` Carsten Dominik
2008-10-27 0:55 ` Sebastian Rose
2008-10-27 2:37 ` Sebastian Rose
2008-11-02 6:40 ` Carsten Dominik
2008-10-27 1:45 ` Sebastian Rose
2008-11-02 6:43 ` Carsten Dominik
2008-11-02 6:50 ` Carsten Dominik
2008-11-03 11:08 ` Carsten Dominik
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).