unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: guile-user@gnu.org
Subject: Re: guile-lib <p> handling
Date: Mon, 16 Mar 2020 18:15:43 +0100	[thread overview]
Message-ID: <20200316171543.GA26778@tuxteam.de> (raw)
In-Reply-To: <1584366045.2123.1@disroot.org>

[-- Attachment #1: Type: text/plain, Size: 1789 bytes --]

On Mon, Mar 16, 2020 at 02:40:45PM +0100, Michal Herko wrote:
> Dear maintainor of guile-lib.
> I believe the special handling of <p> elements in (htmlprag) module
> to be a bug.
> For example:
> 
> (use-modules (htmlprag))
> (html->shtml "<html><body><div><p>text</p></div></body></html>")
> ; expected result (*TOP* (html (body (div (p "text")))))
> ; actual (*TOP* (html (body (div) (p "text"))))
> 
> Note that the <p> element is parsed outside the <div> element.
> I attach the simple patch to remove the special case for <p> elements.
> 

> diff --git a/src/htmlprag.scm b/src/htmlprag.scm
> index 3bd352b..df99612 100644
> --- a/src/htmlprag.scm
> +++ b/src/htmlprag.scm
> @@ -1099,7 +1099,6 @@
>                (meta     . (head))
>                (noframes . (frameset))
>                (option   . (select))
> -              (p        . (body td th))
>                (param    . (applet))
>                (tbody    . (table))
>                (td       . (tr))

Where did you get htmlprag from? I'll guess it's from the
Debian package guile-lib.

It seems the upstream isn't maintained anymore [1]. The
Debian package page [2] lists a maintainer you might want
to contact.

That said, you are modifying the parser's "parent constraints";
I would go the other direction and add <span> to the set of
<p>'s possible parents:

>                (option   . (select))
> -              (p        . (body td th))
> +              (p        . (body td th span))
>                (param    . (applet))

HTML has changed a lot since htmlprag saw its heyday.

Cheers

[1] https://planet.racket-lang.org/package-source/neil/htmlprag.plt/1/7/planet-docs/htmlprag/index.html
[2] https://packages.debian.org/buster/guile-library

-- tomás

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2020-03-16 17:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 13:40 guile-lib <p> handling Michal Herko
2020-03-16 17:15 ` tomas [this message]
2020-03-16 17:16 ` sirgazil

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.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=20200316171543.GA26778@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=guile-user@gnu.org \
    /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.
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).