-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Bug] HTML language does not recognize inline <script type="module"> as JavaScript #2962
Comments
I can reproduce. It seems like |
We fixed this in vscode. The next monaco editor version will be released soon. |
Seems fixed in 0.33.0, my app works again. You can also close #3090 |
Same with Markdown, when annotating a code code block with unknown language:
Error:
(reproduced on the https://microsoft.github.io/monaco-editor playground). Note that this worked fine on 0.33.0 and broke on 0.34.0. |
1. Apparently, mermaid 9.1.7 no longer sets a `height` attribute on the SVG it produces. Workaround by extracting height from `viewBox` instead. 2. Filter out unresolvable Monaco errors from error display. Fixes: go-gitea#21427 Ref: microsoft/monaco-editor#2962
monaco.editor.create(document.getElementById('container'), {
value: "```notsupport\nerror when press enter\n```",
language: 'markdown'
});
+ monaco.languages.register({id: 'vs.editor.nullLanguage'})
+ monaco.languages.setLanguageConfiguration('vs.editor.nullLanguage', {})
monaco.editor.create(document.getElementById('container'), {
value: "```notsupport\nerror when press enter\n```",
language: 'markdown'
}); |
This will be fixed with the next release of the monaco editor.
This is the remaining feature request of this issue. |
Was this fix released? |
Tested #2962 (comment) in playground, the error is present in 0.34.1 and gone in 0.35.0 so this issue should be closed. |
This workaround is not neccessary any more since monaco 0.35.0. Ref: microsoft/monaco-editor#2962 Ref: microsoft/vscode#173688
This workaround is not neccessary any more since monaco 0.35.0. Ref: microsoft/monaco-editor#2962 Ref: microsoft/vscode#173688 (cherry picked from commit d9b37d085acb7e93409061e541b6a3aa53261bb0)
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
Actual Behavior
The contents of the script tag are marked as language
vs.editor.nullLanguage
, precluding highlighting and, upon editing or merely moving the cursor within the tag, causing various callbacks for editor features to throwUnexpected languageId
when callingLanguageConfigurationRegistry.getLanguageConfiguration
.Expected Behavior
Inline code is recognized as JavaScript, is syntax highlighted, and editing/navigation does not raise exceptions.
Additional Context
This began causing exceptions in version 0.32.0, with 0.31.1 and prior nothing is raised but the inline code is still similarly marked as
vs.editor.nullMode
.The text was updated successfully, but these errors were encountered: