Skip to content

[209_18] add option to insert json code in toolbar#2993

Merged
da-liii merged 2 commits intoMoganLab:mainfrom
1sh-repalto:1sh-repalto/209_18/option-to-add-json-code
Mar 17, 2026
Merged

[209_18] add option to insert json code in toolbar#2993
da-liii merged 2 commits intoMoganLab:mainfrom
1sh-repalto:1sh-repalto/209_18/option-to-add-json-code

Conversation

@1sh-repalto
Copy link
Copy Markdown
Contributor

Fixes #2678
json需要放到工具栏中

Summary

Added JSON to the "Inline code" and "Block of code" menus in toolbar.

Developer Document: devel/209_18.md

Issue Found

Users were unable to insert JSON code blocks directly from the editor's code menu because the option didn't exist.

Changes

In TeXmacs/progs/prog/prog-menu.scm:

  • Added ("JSON" (make* 'json "json")) to the "Inline code" submenu.
  • Added ("JSON" (make* 'json-code "json")) to the "Block of code" submenu.

In TeXmacs/plugins/json/progs/code/json-lang.scm:

  • Updated the numeric literal parser-feature to check for lan "json" instead of "javascript".
  • Updated the texmacs-module definition to include (:use (prog default-lang)).
- (texmacs-module (code json-lang))
+ (texmacs-module (code json-lang)
+   (:use (prog default-lang)))

How to Test

  1. Open Mogan.
  2. Go to the code menu in the toolbar or Insert -> Code.
  3. Verify that JSON appears under both Inline code and Block of code.
  4. Select JSON under Block of code and verify it inserts a <json-code|...> block.

Before

Screenshot 2026-03-16 181223

After

Screenshot 2026-03-16 181034 image

@1sh-repalto 1sh-repalto changed the title [209_18] add option to add json code in toolbar [209_18] add option to insert json code in toolbar Mar 16, 2026
Copy link
Copy Markdown
Contributor

@da-liii da-liii left a comment

Choose a reason for hiding this comment

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

LGTM

@da-liii da-liii merged commit 2f91602 into MoganLab:main Mar 17, 2026
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.

json需要放到工具栏中

2 participants