Skip to content

Commit aab6cde

Browse files
committed
Enable Plain Text Spellchecker for Markdown
1 parent e45a4ab commit aab6cde

4 files changed

Lines changed: 45 additions & 4 deletions

File tree

ide/markdown/manifest.mf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Manifest-Version: 1.0
22
AutoUpdate-Show-In-Client: true
33
OpenIDE-Module: org.netbeans.modules.markdown
4+
OpenIDE-Module-Layer: org/netbeans/modules/markdown/layer.xml
45
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/markdown/Bundle.properties
56
OpenIDE-Module-Specification-Version: 1.20
67

ide/markdown/src/org/netbeans/modules/markdown/MarkdownDataObject.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@
105105
@GrammarRegistration(mimeType=MarkdownDataObject.MIME_TYPE, grammar="markdown.tmLanguage.json")
106106
public class MarkdownDataObject extends MultiDataObject {
107107

108-
public static final String MIME_TYPE = "text/x-markdown-nb";
108+
public static final String MIME_TYPE = "text/x-markdown";
109109

110110
public MarkdownDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
111111
super(pf, loader);
112-
registerEditor("text/x-markdown", true);
112+
registerEditor(MIME_TYPE, true);
113113
}
114114

115115
@Override
@@ -120,7 +120,7 @@ protected int associateLookup() {
120120
@MultiViewElement.Registration(
121121
displayName = "#LBL_Markdown_EDITOR",
122122
iconBase = "org/netbeans/modules/markdown/markdown.png",
123-
mimeType = "text/x-markdown",
123+
mimeType = MarkdownDataObject.MIME_TYPE,
124124
persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
125125
preferredID = "Markdown",
126126
position = 1000

ide/markdown/src/org/netbeans/modules/markdown/MarkdownViewerElement.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
@MultiViewElement.Registration(
7272
displayName = "#LBL_MarkdownViewer",
7373
iconBase = "org/netbeans/modules/markdown/markdown.png",
74-
mimeType = "text/x-markdown",
74+
mimeType = MarkdownDataObject.MIME_TYPE,
7575
persistenceType = TopComponent.PERSISTENCE_NEVER,
7676
preferredID = "MarkdownViewer",
7777
position = 2000
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
22+
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
23+
<filesystem>
24+
<folder name="Editors">
25+
<folder name="text">
26+
<folder name="x-markdown">
27+
<folder name="TokenListProvider">
28+
<file name="org-netbeans-modules-spellchecker-plain-PlainTokenListProvider.instance" />
29+
</folder>
30+
<folder name="CompletionProviders">
31+
<file name="org-netbeans-modules-spellchecker-completion-WordCompletion.instance">
32+
<attr name="position" intvalue="600"/>
33+
</file>
34+
</folder>
35+
</folder>
36+
</folder>
37+
</folder>
38+
</filesystem>
39+
40+

0 commit comments

Comments
 (0)