Skip to content

MBS-10904: Allow linebreaks in discussion - #109

Open
sh-csg wants to merge 1 commit into
masterfrom
MBS-10904-Allow-linebreaks-in-discussion
Open

MBS-10904: Allow linebreaks in discussion#109
sh-csg wants to merge 1 commit into
masterfrom
MBS-10904-Allow-linebreaks-in-discussion

Conversation

@sh-csg

@sh-csg sh-csg commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@sh-csg sh-csg self-assigned this Jul 8, 2026
@sh-csg
sh-csg requested a review from Copilot July 8, 2026 05:39
@sh-csg
sh-csg force-pushed the MBS-10904-Allow-linebreaks-in-discussion branch from 3fe60af to b5a6459 Compare July 8, 2026 05:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the kanban discussion message rendering to preserve user-entered line breaks when discussion content is returned to the frontend.

Changes:

  • Bump plugin version to trigger upgrade processing.
  • Adjust external return metadata for discussion content (PARAM_TEXTPARAM_RAW).
  • Render discussion content with format_text(..., ['para' => false, 'context' => ...]) plus nl2br() to convert newlines to <br />.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
version.php Increments plugin version for upgrade tracking.
classes/external/get_kanban_content.php Updates discussion return type and converts newlines to <br /> in get_discussion_update().
classes/boardmanager.php Converts newlines to <br /> when adding a discussion message so immediate updates preserve line breaks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread classes/boardmanager.php Outdated
Comment on lines 943 to 945
$update['content'] = format_text($update['content'], FORMAT_HTML, ['para' => false, 'context' => context_module::instance($this->cmid)]);
$update['content'] = nl2br($update['content']);
if (!empty($this->kanban->usenumbers) && !empty($this->kanban->linknumbers)) {
Comment thread classes/external/get_kanban_content.php

@PhMemmel PhMemmel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have you taken using format_text(..., FORMAT_PLAIN) into consideration? This feels a little bit straightforward for what you want to achieve here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants