Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation editor: Code block support and block format status #12406

Merged
merged 5 commits into from
Mar 4, 2025

Conversation

kazcw
Copy link
Contributor

@kazcw kazcw commented Mar 3, 2025

New features:

  • New button: Insert code block. Inserts a code block after the cursor, or converts the selected text to a code block.
  • Block type menu now shows current type.
Gravacao.do.ecra.2025-03-03.as.15.45.12.mov

Bug fixes:

  • Fix: In a multiline block quote, the space was not included as part of the delimiter except when parsing the first line.
  • Fix: Fenced code block delimiters were not shown when the cursor was inside the block.
  • Fix: Inline formatting now respects block-formatting delimiters.
  • Fix: Formatting controls were enabled inside code blocks.
  • Fix: Inline-formatted text within list items was not rendered.
  • Fix: Table rendering.
  • Fix: Inline-formatting first word of header.

Fixes #11970

Pull Request Description

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

@kazcw kazcw added the CI: No changelog needed Do not require a changelog entry for this PR. label Mar 3, 2025
@kazcw kazcw marked this pull request as ready for review March 3, 2025 23:49
Copy link

github-actions bot commented Mar 3, 2025

🧪 Storybook is successfully deployed!

📊 Dashboard:

Comment on lines 107 to 119
/*
{ // FIXME
source: '# *Formatted header*',
expected: [
'Document',
[
'ATXHeading1',
['HeaderMark', '# '],
['Emphasis', ['EmphasisMark', '*'], ['EmphasisMark', '*']],
],
],
},
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

What is to be fixed here? Do we have a task for it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed it.

* selected range.
*/
export function canInsertCodeBlock(_state: EditorState): boolean {
// TODO: Disable button when the cursor is already inside an unformattable block.
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO left - when we would fix that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented a solution that covers most cases.

Base automatically changed from wip/kw/lezer-markdown to develop March 4, 2025 16:56
kazcw added 3 commits March 4, 2025 09:42
New features:
- New button: Insert code block. Inserts a code block after the cursor, or converts the selected text to a code block.
- Block type menu now shows current type.

Bug fixes:
- Fix: In a multiline block quote, the space was not included as part of the
  delimiter except when parsing the first line.
- Fix: Fenced code block delimiters were not shown when the cursor was inside the block.
- Fix: Inline formatting now respects block-formatting delimiters.
- Fix: Formatting controls were enabled inside code blocks.
- Fix: Inline-formatted text within list items was not rendered.
@kazcw kazcw force-pushed the wip/kw/docs-code-blocks branch from 6f72e6b to 689435b Compare March 4, 2025 18:24
@kazcw kazcw added the CI: Ready to merge This PR is eligible for automatic merge label Mar 4, 2025
@mergify mergify bot merged commit f534af4 into develop Mar 4, 2025
60 of 63 checks passed
@mergify mergify bot deleted the wip/kw/docs-code-blocks branch March 4, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add back helper buttons for doc panel - Multi-line elements: code blocks
2 participants