Skip to content

Conversation

@andrey18106
Copy link
Contributor

Summary

Enable markdown support for comment content block (NcRichText). Increase max comment block height limit, add scroll.

image

Checklist

@andrey18106 andrey18106 requested a review from a team as a code owner August 27, 2025 20:34
@andrey18106 andrey18106 requested review from nfebe, skjnldsv and szaimen and removed request for a team August 27, 2025 20:34
@skjnldsv
Copy link
Member

Labels ? Milestone ?
Is it scheduled for 32 or just something you're working on ?

@susnux
Copy link
Contributor

susnux commented Aug 28, 2025

I fear a bit that this break accessibility of the comments because of headings.
if you put e.g.

# heading 1
some test

into the markdown than this will be rendered as <h1> in the sidebar, but this might be semantically wrong for the page layout. @Antreesy how do you handle this in Talk to ensure the page semantics stay correct?

@Antreesy
Copy link
Contributor

Antreesy commented Aug 28, 2025

how do you handle this in Talk to ensure the page semantics stay correct?

Here's the trick: we don't 🤷🏽
But I think we can tweak on vue-library side to render # expect h1 in h2 tag. They're locked to the same size anyway

@DaphneMuller
Copy link

Labels ? Milestone ? Is it scheduled for 32 or just something you're working on ?

@skjnldsv it is not scheduled for Nextcloud 32 specifically, since feature freeze has passed

@szaimen szaimen added enhancement 3. to review Waiting for reviews labels Aug 28, 2025
@szaimen szaimen added this to the Nextcloud 33 milestone Aug 28, 2025
@DaphneMuller
Copy link

@susnux @Antreesy what would be the next step here?

@Antreesy
Copy link
Contributor

Antreesy commented Oct 8, 2025

what would be the next step here?

Ensure that NcRichText satisfies a11y requirements, as I'm not sure it was a part of BITV certification (Talk app was not). Then it should be good to go

@DaphneMuller
Copy link

@Antreesy and do you know who I can ask this to?

@Antreesy
Copy link
Contributor

it was a part of BITV certification

I'd assume, Ferdinand, Grigorii or Julia might help

@DaphneMuller
Copy link

@JuliaKirschenheuter @ShGKme @susnux can some of you review this PR please? There are concerns regarding the accessibility

@DaphneMuller
Copy link

ping @JuliaKirschenheuter

@ShGKme
Copy link
Contributor

ShGKme commented Oct 27, 2025

Checking the possibilities

@ShGKme
Copy link
Contributor

ShGKme commented Oct 27, 2025

The only solution I see: while keeping the original style, level down headings inside NcRichText:

  • h1 -> h4, h2 -> h5, h3 -> h6
  • h4, h5, h6 -> also h6...

I'd also consider making the style of the heading smaller, so people don't use h4 as the first heading just to have a small font size heading.

@ShGKme
Copy link
Contributor

ShGKme commented Oct 27, 2025

This also breaks comments of users using only h3..h6. But we can either ignore it (they should have used h1..h3), or we can manually increase the level before levelling it down, if high-level headings are unused.

@susnux
Copy link
Contributor

susnux commented Oct 27, 2025

The only solution I see: while keeping the original style, level down headings inside NcRichText:

We do similar in apps/settings/src/components/Markdown.vue
Where we limit the min heading to not interfere with current context of headings.

@ShGKme
Copy link
Contributor

ShGKme commented Oct 27, 2025

I wouldn't limit the users from using #, ##, ###.

Instead, I'd render them as low-level headings, and "disrespect" using ####, #####, ###### by making them the same visually.

In this case users by default use valid internal and short structure.

@susnux
Copy link
Contributor

susnux commented Oct 27, 2025

Instead, I'd render them as low-level headings, and "disrespect" using ####, #####, ###### by making them the same visually.

Thats what it is doing.
Its rendered visually as the correct h but semantically its then clamped

@ShGKme
Copy link
Contributor

ShGKme commented Oct 28, 2025

@julien-nc julien-nc force-pushed the feat/comments/markdown-support branch from 81eeac6 to 6d4da35 Compare November 28, 2025 10:03
@julien-nc julien-nc requested review from ShGKme and susnux November 28, 2025 10:23
@julien-nc
Copy link
Member

Hey there. This has been rebased on master, all good with nc/vue 9.3.0 and the max title level.
Anything else I should adjust?

Copy link
Contributor

@Antreesy Antreesy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far looks fine. If some markdown styles are to be adjusted, it's better to do it upstream and keep it simple here

There's also use-extended-markdown prop that add some more features, as markdown tables or code syntax highlight, but I don't think it's worth it (plus it also increases the bundle size)

Comment on lines +389 to +392
:deep(img) {
max-width: 100%;
height: auto;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we need to add it to upstream. Or forbid images...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soudns good and should than be a follow up 👍

@ShGKme
Copy link
Contributor

ShGKme commented Nov 28, 2025

(plus it also increases the bundle size)

But in async chunk

@AndyScherzinger AndyScherzinger merged commit 8cd86fb into master Nov 28, 2025
143 of 151 checks passed
@AndyScherzinger AndyScherzinger deleted the feat/comments/markdown-support branch November 28, 2025 14:42
@RokeJulianLockhart
Copy link

There's also use-extended-markdown prop that add some more features, as markdown tables or code syntax highlight, but I don't think it's worth it.

@Antreesy, I'd appreciate those features. They're mostly why I wanted this functionality.

@nextcloud-bot nextcloud-bot mentioned this pull request Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown support in Comments