Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ide/editor.settings.storage/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
<friend>org.netbeans.modules.gsf</friend>
<friend>org.netbeans.modules.jvi</friend>
<friend>org.netbeans.modules.languages</friend>
<friend>org.netbeans.modules.markdown</friend>
<friend>org.netbeans.modules.options.editor</friend>
<friend>org.netbeans.modules.editor.fold</friend>
<friend>org.netbeans.modules.editor.fold.nbui</friend>
Expand Down
1 change: 1 addition & 0 deletions ide/libs.flexmark/external/binaries-list
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ A3F92ABD0ACBB4D1F12DFD3D6128F73D245D6BA9 com.vladsch.flexmark:flexmark-util-data
985913246DF64FE7E768EB0664B45DEDEA7536CF com.vladsch.flexmark:flexmark-util-sequence:0.64.8
A8178BA6DFD7A958353A60B3A51FE7EDB1578B49 com.vladsch.flexmark:flexmark-util-visitor:0.64.8
4ADC75ADA3D870908BDBFFB76650D19305250D3C com.vladsch.flexmark:flexmark-ext-gfm-tasklist:0.64.8
1851E124C6D85C5C7F3FDBBE066D30A76AD6BE44 com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:0.64.8
CD56EB47DCD4590EF6451F87E5EC33BDDD1A9A51 org.jsoup:jsoup:1.15.4
2 changes: 1 addition & 1 deletion ide/libs.flexmark/external/flexmark-0.64.8-license.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version: 0.64.8
License: BSD-flexmark
Description: FlexMark library
Origin: https://github.com/vsch/flexmark-java
Files: flexmark-0.64.8.jar flexmark-ext-anchorlink-0.64.8.jar flexmark-ext-emoji-0.64.8.jar flexmark-ext-tables-0.64.8.jar flexmark-html2md-converter-0.64.8.jar flexmark-util-ast-0.64.8.jar flexmark-util-builder-0.64.8.jar flexmark-util-collection-0.64.8.jar flexmark-util-data-0.64.8.jar flexmark-util-dependency-0.64.8.jar flexmark-util-format-0.64.8.jar flexmark-util-html-0.64.8.jar flexmark-util-misc-0.64.8.jar flexmark-util-sequence-0.64.8.jar flexmark-util-visitor-0.64.8.jar flexmark-ext-gfm-tasklist-0.64.8.jar
Files: flexmark-0.64.8.jar flexmark-ext-anchorlink-0.64.8.jar flexmark-ext-emoji-0.64.8.jar flexmark-ext-tables-0.64.8.jar flexmark-html2md-converter-0.64.8.jar flexmark-util-ast-0.64.8.jar flexmark-util-builder-0.64.8.jar flexmark-util-collection-0.64.8.jar flexmark-util-data-0.64.8.jar flexmark-util-dependency-0.64.8.jar flexmark-util-format-0.64.8.jar flexmark-util-html-0.64.8.jar flexmark-util-misc-0.64.8.jar flexmark-util-sequence-0.64.8.jar flexmark-util-visitor-0.64.8.jar flexmark-ext-gfm-tasklist-0.64.8.jar flexmark-ext-gfm-strikethrough-0.64.8.jar

Copyright (c) 2015-2016, Atlassian Pty Ltd
All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion ide/libs.flexmark/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ Manifest-Version: 1.0
AutoUpdate-Show-In-Client: true
OpenIDE-Module: org.netbeans.libs.flexmark
OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/flexmark/Bundle.properties
OpenIDE-Module-Specification-Version: 1.25
OpenIDE-Module-Specification-Version: 1.26

1 change: 1 addition & 0 deletions ide/libs.flexmark/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ release.external/flexmark-ext-emoji-0.64.8.jar=modules/ext/flexmark-ext-emoji-0.
release.external/flexmark-ext-anchorlink-0.64.8.jar=modules/ext/flexmark-ext-anchorlink-0.64.8.jar
release.external/flexmark-ext-tables-0.64.8.jar=modules/ext/flexmark-ext-tables-0.64.8.jar
release.external/flexmark-ext-gfm-tasklist-0.64.8.jar=modules/ext/flexmark-ext-gfm-tasklist-0.64.8.jar
release.external/flexmark-ext-gfm-strikethrough-0.64.8.jar=modules/ext/flexmark-ext-gfm-strikethrough-0.64.8.jar
release.external/jsoup-1.15.4.jar=modules/ext/jsoup-1.15.4.jar

# Sigtest seems to have issues with some Java 11 class files, better to disable it.
Expand Down
68 changes: 36 additions & 32 deletions ide/libs.flexmark/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,72 +30,76 @@
<subpackages>org.jsoup</subpackages>
</public-packages>
<class-path-extension>
<runtime-relative-path>ext/flexmark-html2md-converter-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-html2md-converter-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/jsoup-1.15.4.jar</runtime-relative-path>
<binary-origin>external/jsoup-1.15.4.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-ast-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-ast-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-util-misc-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-misc-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-builder-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-builder-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-util-dependency-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-dependency-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-collection-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-collection-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-util-visitor-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-visitor-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-data-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-data-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-ext-anchorlink-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-ext-anchorlink-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-dependency-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-dependency-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-ext-gfm-tasklist-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-ext-gfm-tasklist-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-format-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-format-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-util-builder-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-builder-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-html-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-html-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-misc-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-misc-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/jsoup-1.15.4.jar</runtime-relative-path>
<binary-origin>external/jsoup-1.15.4.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-sequence-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-sequence-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-util-format-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-format-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-visitor-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-visitor-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-html2md-converter-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-html2md-converter-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-ext-emoji-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-ext-emoji-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-ext-anchorlink-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-ext-anchorlink-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-ast-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-ast-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-util-data-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-data-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-ext-tables-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-ext-tables-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-util-collection-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-collection-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-ext-gfm-tasklist-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-ext-gfm-tasklist-0.64.8.jar</binary-origin>
<runtime-relative-path>ext/flexmark-util-sequence-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-util-sequence-0.64.8.jar</binary-origin>
</class-path-extension>
<class-path-extension>
<runtime-relative-path>ext/flexmark-ext-gfm-strikethrough-0.64.8.jar</runtime-relative-path>
<binary-origin>external/flexmark-ext-gfm-strikethrough-0.64.8.jar</binary-origin>
</class-path-extension>
</data>
</configuration>
Expand Down
7 changes: 6 additions & 1 deletion ide/markdown/licenseinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,10 @@
<file>src/org/netbeans/modules/markdown/resources/Template.md</file>
<license ref="Apache-2.0-ASF" />
<comment type="TEMPLATE_MINIMAL_IP" />
</fileset>
</fileset>
<fileset>
<file>src/org/netbeans/modules/markdown/resources/Coloring.md</file>
<license ref="Apache-2.0-ASF" />
<comment type="TEMPLATE_MINIMAL_IP" />
</fileset>
</licenseinfo>
1 change: 1 addition & 0 deletions ide/markdown/manifest.mf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Manifest-Version: 1.0
AutoUpdate-Show-In-Client: true
OpenIDE-Module: org.netbeans.modules.markdown
OpenIDE-Module-Layer: org/netbeans/modules/markdown/resources/layer.xml
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/markdown/Bundle.properties
OpenIDE-Module-Specification-Version: 1.20

2 changes: 1 addition & 1 deletion ide/markdown/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
# specific language governing permissions and limitations
# under the License.

javac.source=1.8
javac.source=17
Copy link
Member

Choose a reason for hiding this comment

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

good but javac.release=17 please ;) (#8813)

javac.compilerargs=-Xlint -Xlint:-serial
27 changes: 27 additions & 0 deletions ide/markdown/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,33 @@
<specification-version>1.15</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.editor.mimelookup</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.72</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.editor.settings</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.89</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.editor.settings.storage</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>1</release-version>
<specification-version>1.84</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.textmate.lexer</code-name-base>
<build-prerequisite/>
Expand Down
12 changes: 12 additions & 0 deletions ide/markdown/src/org/netbeans/modules/markdown/Bundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ OpenIDE-Module-Long-Description=\
Syntax highlighting for Markdown.
OpenIDE-Module-Name=Markdown Support
OpenIDE-Module-Short-Description=Syntax highlighting for Markdown

CSS_DEFAULT=body {padding:40px;}\
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {font-size:inherit;}\
ul, li ul {margin-left: 20px;}\
li {margin-bottom: 3px;padding-left:5px;}\
table {border-spacing:0;}\
th, td {border:1px solid rgb(209, 217, 224); padding:10px;}\
code {border-radius: 6px;}\
pre {padding:16px;}\
pre code {border-radius:0px;}\
blockquote {padding: 0 16px; margin: 0px; border-left: 2px solid rgb(209, 217, 224);}\
li blockquote {margin-bottom: 0px;}
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@
@GrammarRegistration(mimeType=MarkdownDataObject.MIME_TYPE, grammar="markdown.tmLanguage.json")
public class MarkdownDataObject extends MultiDataObject {

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

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.netbeans.modules.markdown;

import com.vladsch.flexmark.ext.anchorlink.AnchorLinkExtension;
import com.vladsch.flexmark.ext.gfm.strikethrough.StrikethroughExtension;
import com.vladsch.flexmark.ext.gfm.tasklist.TaskListExtension;
import com.vladsch.flexmark.ext.tables.TablesExtension;
import com.vladsch.flexmark.html.HtmlRenderer;
Expand All @@ -27,6 +28,8 @@
import com.vladsch.flexmark.util.data.MutableDataSet;
import java.awt.BorderLayout;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
Expand All @@ -49,6 +52,8 @@
import org.netbeans.core.spi.multiview.CloseOperationState;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.MultiViewElementCallback;
import org.netbeans.modules.editor.settings.storage.api.EditorSettings;
import static org.netbeans.modules.markdown.MarkdownDataObject.MIME_TYPE;
import org.netbeans.modules.markdown.ui.preview.MarkdownEditorKit;
import org.openide.awt.HtmlBrowser;
import org.openide.awt.UndoRedo;
Expand All @@ -62,6 +67,7 @@
import org.openide.util.NbBundle.Messages;
import org.openide.util.RequestProcessor;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.WeakListeners;
import org.openide.windows.TopComponent;

/**
Expand All @@ -71,7 +77,7 @@
@MultiViewElement.Registration(
displayName = "#LBL_MarkdownViewer",
iconBase = "org/netbeans/modules/markdown/markdown.png",
mimeType = "text/x-markdown",
mimeType = MIME_TYPE,
persistenceType = TopComponent.PERSISTENCE_NEVER,
preferredID = "MarkdownViewer",
position = 2000
Expand All @@ -94,7 +100,8 @@ public class MarkdownViewerElement implements MultiViewElement {
.set(Parser.EXTENSIONS, Arrays.asList(
AnchorLinkExtension.create(),
TablesExtension.create(),
TaskListExtension.create()
TaskListExtension.create(),
StrikethroughExtension.create()
))
.set(HtmlRenderer.INDENT_SIZE, 2)
.set(HtmlRenderer.RENDER_HEADER_ID, true)
Expand All @@ -111,6 +118,9 @@ public class MarkdownViewerElement implements MultiViewElement {
.set(TablesExtension.APPEND_MISSING_COLUMNS, true)
.set(TablesExtension.DISCARD_EXTRA_COLUMNS, true)
.set(TablesExtension.HEADER_SEPARATOR_COLUMN_MATCH, true)
// Strikethrough change from del to s tag
.set(StrikethroughExtension.STRIKETHROUGH_STYLE_HTML_OPEN, "<s>")
.set(StrikethroughExtension.STRIKETHROUGH_STYLE_HTML_CLOSE, "</s>")
.toImmutable();

final Parser parser = Parser.builder(OPTIONS).build();
Expand All @@ -134,6 +144,9 @@ public void changedUpdate(DocumentEvent e) {
};

private final Task updater = RP.create(MarkdownViewerElement.this::updateView);
//event for Font config update
private volatile boolean fontChanged = false;
private final PropertyChangeListener pcl = this::colorProfileChange;
private StyledDocument source;

public MarkdownViewerElement(Lookup lookup) {
Expand All @@ -143,6 +156,7 @@ public MarkdownViewerElement(Lookup lookup) {
@Override
public JComponent getVisualRepresentation() {
if (component == null) {
EditorSettings.getDefault().addPropertyChangeListener(WeakListeners.propertyChange(pcl, this));
viewer = new JEditorPane();
viewer.setEditorKit(new MarkdownEditorKit());
viewer.setEditable(false);
Expand Down Expand Up @@ -289,4 +303,21 @@ private void linkHandler(HyperlinkEvent evt) {
}
}
}

/**
* redraw document if profile changes
* @param evt
*/
public void colorProfileChange(PropertyChangeEvent evt) {
//TODO check some context
if (!fontChanged && "fontColors".equals(evt.getPropertyName())) { // NOI18N
//not very safe
//fontChanged = true;
}
if (fontChanged || EditorSettings.PROP_CURRENT_FONT_COLOR_PROFILE.equals(evt.getPropertyName())) {
fontChanged = false;
viewer.setEditorKit(new MarkdownEditorKit());
updateView();
}
}
}
Loading
Loading