I'm not sure I follow completely, but I think the problem is the
compound-paragraph parsing that is triggered by the lack of space
between the two `para` calls:

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

If you change it to

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

 @para{Bar.}}

then the "SIntrapara" layer goes away.

If all the arguments to `foo` will be paragraphs, then one solution is
skip the `decode-flow` call that is creating a compound paragraph. In
that case, use square brackets, since `foo` then expects normal
arguments instead of text-mode argument:

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

Meanwhile, it may be that compound paragraphs do not render in to HTML
in a valid way (within a nested flow?). But I think the immediate
problem is that you don't want the compound paragraph.

At Wed, 4 Dec 2019 11:09:40 +0000, Reuben Thomas wrote:
> 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/5de7b860.1c69fb81.e2da.eb45SMTPIN_ADDED_MISSING%40gmr-mx.google.com.

Reply via email to