ilovepi wrote:

> > I guess that makes me wonder if we want a `\<pre\><pre/>` tag surrounding 
> > those, since they aren't really using any kind of special formatting for 
> > alignment or font.
> 
> We need `\<pre\>` tags surrounding `code` blocks for highlight.js.
> 

I think this probably makes sense for top level entities, like these type 
identifiers for the class and namespace.

> https://github.com/highlightjs/highlight.js?tab=readme-ov-file#in-the-browser
> 
> If want it done a different way, without needing the `\<pre\>` tags, we can 
> explore that.
> 
> https://github.com/highlightjs/highlight.js?tab=readme-ov-file#using-custom-html
> 

The custom route is something I'd prefer to avoid if we can. It introduces a 
lot of complexity and extra JS to manage.

> But I think the `pre` tags help to preserve line breaks and indentation in 
> the code blocks themselves. So if someone uses a `@code` command in comments, 
> the `\<pre\>` preserves their intended indentation and line breaks.

For general code blocks, sure, but I'm not sure how much we rely on it for 
formatting the top level identifiers, like what's in this patch. I guess, maybe 
its always fine to just wrap them "tightly" on a single line? I can't seem to 
think of a scenario where I'd expect that to do the wrong thing.  Though, I'll 
admit I haven't thought of it too much, and I really need to see/play with 
concrete HTML to understand it personally.


https://github.com/llvm/llvm-project/pull/166672
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to