After a few more experiments, I find that I can't work out another problem
I was having: nested <p> elements (which is not legal HTML).

This occurs when I put a style on a @para; for example, a small change to
the example code that Matthew kindly provided:

#lang scribble/base
@(require scribble/core
          scribble/decode
          scribble/html-properties)

@(define foo-style (make-style "foo" (list (alt-tag "div"))))
@(define (foo . content) (make-nested-flow foo-style (decode-flow content)))

@foo{@para[#:style "foo"]{Bar.}
@para{Bar.}

This generates (excerpted):

<div class="foo"><p><div class="SIntrapara"><p
class="foo">Bar.</p></div><div
class="SIntrapara">Bar.</div></p></div></div></div>

My understanding is that a nested flow should be able to contain multiple
paragraphs. If I remove the style then the extra <p> elements are not
generated, but this doesn't seem to be the real problem; rather, it's that
the paragraphs are wrapped in a single <p> element containing <div
class="SIntrapara"> elements for the actual paragraphs. I find the
following documentation:

  [@css{SIntrapara} @elem{Used with @tt{<div>} instead of @tt{<p>} for a
paragraph
                       within a @racket[compound-paragraph].}]

So it looks as though the contents of @foo is being treated as a "compound
paragraph", which itself is a somewhat tricky idea to me: it looks like
it's a way to typeset multiple paragraphs without each one being indented
(so really multiple paragraphs?) yet, as the name suggests, it's clearly
modelled as a single paragraph. But surely multiple @para's with a
nested-flow should work correctly?

I'm sorry, I can't work out whether the confusion is purely mine, or
whether there's something on going on in Scribble here!

-- 
https://rrt.sc3d.org

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAOnWdojgEUr7Wuncg8%2BesnjgHMFjvzoPpzj6xtiPJJ9GMXsF%2BA%40mail.gmail.com.

Reply via email to