emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bastien <bzg@gnu.org>
To: TEC <tecosaur@gmail.com>
Cc: org-mode-email <emacs-orgmode@gnu.org>
Subject: Re: W3C violations in Org's HTML export
Date: Fri, 30 Apr 2021 10:27:46 +0200	[thread overview]
Message-ID: <87eeesb57i.fsf@bzg.fr> (raw)
In-Reply-To: <87sga4914t.fsf@gmail.com> (TEC's message of "Sat, 24 Oct 2020 03:04:22 +0800")

Hi Timothy,

TEC <tecosaur@gmail.com> writes:

> * Error: Element p not allowed as child of element h2 in this 
>   context
>   Org currently seems to put a p.subtitle inside the heading.
>   This violates the "phrasing content" restriction.
>   https://html.spec.whatwg.org/multipage/sections.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements
>
> ** Suggestion
>    Make the subtitle an independent element, is can still be a
>    p.subtitle, just not /inside/ the h2 title

Agreed, can you provide a patch for this?

> * Warning: The type attribute is unnecessary for JavaScript 
>   resources.
>   This seems to be from the '<script type="text/javascript">' code
>   highlighting script.
>
> ** Suggestion
>    Remove the ' type="text/javascript"' part of that.

Done.

> * Error: Attribute alt not allowed on element object at this 
>   point.
>   This occurs when one has an svg figure, and one wishes to add 
>   alt text
>   (good for accessibility). This is of course applied to the 
>   <object
>   type="image/svg+xml">.
>   
>   What's interesting here is that the benefit of using an <object> 
>   over
>   an <img> for SVGs seems to basically be that it allows for a 
>   raster
>   fallback (with the downside that it is downloaded even when not
>   needed). However... if we're using HTML5, the <picture> element 
>   exists
>   for exactly this case, and provides a better implementation of
>   fallbacks. Even if one is not using HTML5, I don't see any way 
>   that
>   Org actually makes use of the potential for a raster fallback 
>   ...
>   raising the question of why an <object> is used over <img> in 
>   the
>   first place. It appears that browser support for SVGs in <img> 
>   tags
>   was originally sketchy, however that issue seems to have bee 
>   long
>   since resolved: https://caniuse.com/svg-img
>
> ** Suggestion
>    Switch <object> to <img> for SVGs, if Org does add a mechanism 
>    for
>    defining fallback images in the future, use <picture> with 
>    HTML5

Can you confirm the two issues above are already fixed?

> * Error: Duplicate ID org0424ed6.
>   Clearly, this can happen. I'm not sure how.
>   I'd like to draw attention to this email I sent a while ago 
>   (excuse
>   the mangled start)
>   https://orgmode.org/list/E1jxAjq-0004Dk-LH@lists.gnu.org/

I cannot reproduce this.

> * Error: Character reference expands to a control character 
>   (U+0002).
>   I have no idea where this is coming from, or why it's there --- 
>   but it
>   is, and it's not alone:
>   + Error: Character reference expands to a control character 
>   (U+001d).
>   + Error: Character reference expands to a control character 
>   (U+001f).
>   + Error: Character reference expands to a control character 
>   (U+0016).
>   + Error: Character reference expands to a control character 
>   (U+000f).
>   + Warning: Document uses the Unicode Private Use Area(s), which 
>   should
>     not be used in publicly exchanged documents. (Charmod C073)
>   + Error: Character reference expands to a control character 
>   (U+001b).
>
>   I suspect this may be htmlize, but I'm not sure, and it's 
>   Org-related,
>   so I'll include it.

I don't observe this, a reproducible recipe is welcome.

> * (not an error) Difficulty in 'wrapping' sections
>   It's quite reasonable (IMO) to want to wrap a (sub*)section in a
>   certain element, such as a link. Indeed I've wanted to do this 
>   to
>   create clickable 'cards' on the homepage of my org website 
>   revamp.
>   Unfortunately there doesn't seem to be any property like 
>   :HTML_WRAP:
>   etc. that can be applied, forcing me to try this:
>
>   #+begin_src org
>   ,** Features
>   @@html:<a href="features.html">@@
>   [[file:resources/img/stars.svg]]
>
>   Delve into the possibilities.
>   @@html:</a>@@
>   #+end_src
>
>   This produces the following errors:
>   + Error: End tag p seen, but there were open elements.
>   + Error: Unclosed element a.
>   + Error: End tag a violates nesting rules.
>   + Fatal Error: Cannot recover after last error. Any further 
>   errors
>     will be ignored.
>
>   It would be good to have a way to do this that doesn't cause W3C
>   issues.

Once all issues listed here are handles, please close the call for
help with "X-Woof-Help: close" as a header.

Please open a separate proposal for this.

Thanks,

-- 
 Bastien


  parent reply	other threads:[~2021-04-30  8:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 19:04 W3C violations in Org's HTML export TEC
2020-10-24 11:28 ` Bastien
2020-12-17 17:55 ` TEC
2020-12-20 17:11   ` Bastien
2021-04-30  8:27 ` Bastien [this message]
2021-04-30  8:57   ` Timothy
2021-04-30 11:37 ` Bruce D'Arcus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eeesb57i.fsf@bzg.fr \
    --to=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=tecosaur@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).