Releases: msarson/ClarionMarkdownEditor
Release list
v1.3.0 — Auto-refresh, remembered view preferences, and resizable panes
Added
- Auto-refresh on external file changes (#11, reported by Kevin Erskine). Open tabs now track their backing file on disk and update themselves when the file is changed by something outside the editor (e.g. CA/Claude editing a Markdown file you're viewing, or the same file open in VS Code) — no stale views and no manual reload for the common case.
- Clean tabs reload silently in place, preserving scroll position.
- Tabs with unsaved edits are never clobbered — a passive ↻ "changed on disk" badge appears instead; clicking it (or Reload from Disk in the tab context menu) prompts before discarding your changes. Deleted/renamed files flag the tab and keep the buffer.
- Remembered Expand/Split preference (#11). New file tabs open in your last-used view mode instead of always starting split, so view-only users no longer have to click Expand every time. Persisted across sessions. (URL/read-only tabs still open expanded.)
- Resizable editor / preview panes. A draggable splitter lets you set the split to taste — works both side-by-side and stacked, clamped to 15–85%, hides itself in Expanded view, and double-click resets to 50/50. The split ratio and direction are persisted across sessions.
Notes
- The in-place reload preserves scroll, not the caret, because the editor is a plain
<textarea>. True VS-Code-style caret + view tracking is deferred to the CodeMirror 6 migration (#10).
Requirements
- Microsoft Edge WebView2 Runtime (pre-installed on most Windows 10/11 systems).
Install
Extract ClarionMarkdownEditor-v1.3.0.zip into <ClarionRoot>\accessory\addins\ClarionMarkdownEditor\ (the .addin file must land in the root of that folder), then restart the Clarion IDE.
v1.2.0 — Bundle marked@11, drop inline parser
Changed
- Markdown preview is now powered by marked.js 11.2.0 (#8). The inline ~120-line minimal parser that was shadowing the CDN-loaded
markedhas been removed entirely, andmarked.min.jsis now bundled locally underResources/— no CDN dependency, works offline. - Configuration:
gfm: true(GitHub-flavored extensions on),breaks: false(CommonMark behavior). - Mermaid rendering preserved via a
coderenderer override that maps```mermaidfences to<div class="mermaid">…</div>.
Added (features that previously rendered as plain text or broken markup)
- GFM tables, task lists (
- [ ]/- [x]), strikethrough (~~text~~), autolinks (bare URLs and<https://...>) - Hard line breaks (two trailing spaces before
\n) - Escaped characters (
\*,\#, etc.) - Inline HTML passthrough (CommonMark compliant)
- Reference-style links, setext headings, nested lists
Fixed
- No-language fenced code blocks now render as plain monospace — previously
hljs.highlightElementauto-detected and applied speculative tinting. The post-processing selector now requires an explicitlanguage-…class. - Dark-mode CSS specificity bug where the inline
codebackground was winning overpre code, giving nested code blocks a mismatched background. Added a dark-mode-specificpre coderule.
Acknowledgments
Many thanks to Christopher Jeffrey and the marked.js contributors, and Knut Sveidqvist and the Mermaid contributors, whose open source work makes the preview pane possible.
Install
Extract ClarionMarkdownEditor-v1.2.0.zip into <ClarionRoot>\accessory\addins\ClarionMarkdownEditor\ (the .addin file must land in the root of that folder).
v1.1.2 — Strip trailing # on ATX headings
Fixed
- Trailing
#characters on ATX headings were not removed in the preview (#3, reported by Pierre-Jean Quinto). The inline markdown parser stripped the leading#s but left the optional closing#sequence in the rendered text, so# Introduction #rendered asIntroduction #instead ofIntroduction. Per CommonMark §4.2, the closing#sequence — when preceded by whitespace — is decorative and must be stripped. Added a second.replace(/\s+#+\s*$/, '')to the heading text extraction inmarkdown-editor.js.
Install
Extract ClarionMarkdownEditor-v1.1.2.zip into <ClarionRoot>\accessory\addins\ClarionMarkdownEditor\ (the .addin file must land in the root of that folder).
v1.1.1 — Fix format toolbar visible after Start Page → URL tab
Fixed
-
Format toolbar stayed visible when opening a URL into a read-only tab from the Start Page (#5)
Most visible when clicking View README in Addin Finder while the editor's Start Page was up — the URL tab loaded correctly with its 🔒 badge and expanded preview, but the format toolbar (Bold / Italic / etc.) stayed onscreen even though it can't do anything on a locked textarea.
Root cause:
hideStartPagewas managing toolbar visibility with an inlinestyle.display = 'flex', which beat the v1.1.0.format-toolbar.hiddenclass added byapplyFormatToolbarVisibility.applyFormatToolbarVisibilityis now the single source of truth — it also considersisStartPageActive, and clears any stale inlinedisplaybefore toggling the class so class-based rules actually win.
Installation
- Extract the zip into
{CLARION_PATH}\accessory\addins\MarkdownEditor\(overwriting v1.1.0 files). - Unblock the extracted files — right-click the zip → Properties → Unblock before extracting, or
Get-ChildItem "<install path>" -Recurse | Unblock-File. - Restart Clarion.
Full Changelog: v1.1.0...v1.1.1
v1.1.0 — Open Markdown from URL
Added
-
Open Markdown from URL (#4)
Load a Markdown document directly from a URL via Tools → Open Markdown from URL... or the new 🌐 Open URL... button on the Start Page. Three URL forms are accepted:
- Raw URLs (
raw.githubusercontent.com/...) - GitHub blob URLs (
github.com/owner/repo/blob/branch/...) — rewritten to raw on the fly - Bare GitHub repo URLs (
github.com/owner/repo) — probeREADME.mdonmain, fall back tomaster
- Raw URLs (
-
Read-only URL tabs
URL-loaded documents open in a locked tab with a 🔒 badge and italic title. They start in expanded (rendered-only) view because URL tabs are for reading. The format toolbar hides while a read-only tab is active. Ctrl+S routes through Save As to let you save a local editable copy — the tab then drops the lock and the expanded mode.
-
Per-tab expanded/split preference
Expand/Split state is now remembered per tab, so flipping between a URL tab (expanded) and a regular file tab (split) no longer leaks state across them.
-
Relative URL resolution in fetched documents
inside a fetched README resolves against the source URL. Relative.mdlink clicks open as new in-editor tabs. Absolutehttp(s)links open in the system browser viaProcess.Start, so WebView2 never navigates away from the editor. -
Recent URLs list on the Start Page, persisted alongside Recent Files (capped at 15).
-
Public API for cross-addin invocation:
MarkdownEditorApi.OpenUrl(string url)Other Clarion IDE addins can call this via reflection without taking a hard reference on
ClarionMarkdownEditor.dll:var t = Type.GetType("ClarionMarkdownEditor.MarkdownEditorApi, ClarionMarkdownEditor"); t?.GetMethod("OpenUrl")?.Invoke(null, new object[] { url });
-
Disk cache under
%APPDATA%\ClarionMarkdownEditor\cache\Conditional GETs (ETag / If-Modified-Since) make reopens hit 304, and a stale copy is served when the network is unavailable — with a status bar hint so the user knows it's from cache.
-
Friendly fetch errors — distinct messages for 404 / 401–403 / 5xx / timeout / generic transport failure, each labelled with the URL that was attempted.
Changed
System.Net.Httpadded to project references (not in the SDK default for the WindowsDesktop SDK).addTab/updateTabInfoJS signatures gainedisReadOnlyandbaseUrlparameters; defaults preserve old-style calls.
Installation
- Extract the zip into
{CLARION_PATH}\accessory\addins\MarkdownEditor\(overwriting v1.0.2 files). - Unblock the extracted files — right-click the zip → Properties → Unblock before extracting, or run
Get-ChildItem "<install path>" -Recurse | Unblock-Filein PowerShell. - Restart Clarion.
Full Changelog: v1.0.2...v1.1.0
v1.0.2 - Save file corruption fix
Fixed
-
Saving silently corrupted any file containing
<, backslashes, tabs, or non-ASCII characters (#1).WebView2.ExecuteScriptAsyncreturns the script result as a JSON-encoded string. Chromium escapes<as its Unicode escape sequence (HTML-safe embedding), single backslashes as doubled backslashes, and any non-ASCII character as its\uXXXXform. Both save paths (GetEditorContentAsyncandGetTabContentFromJs) hand-rolled a decoder that only handled\n,\r, and\"— every other escape passed through as the literal characters of the escape and was written to disk.As a result:
- Embedded HTML like
<style>was saved with<replaced by a six-character Unicode escape. - Single backslashes in saved content were doubled.
- Any literal backslash-
n(e.g. inside a Windows path) was converted to a real newline, splitting the content across two lines. - Smart quotes, accented letters, em-dashes, emoji and other non-ASCII characters were broken.
Replaced both decoders with a proper JSON string decoder (
DecodeJsonString) that handles the full JSON escape set including\uXXXXsurrogate pairs. - Embedded HTML like
-
Repaired README content previously damaged by this same bug — restored single backslashes in Windows paths, removed Unicode-escape leftovers from XML examples, and rejoined a path that had been split across two lines.
Installation
- Extract the zip into
{CLARION_PATH}\accessory\addins\MarkdownEditor\(overwriting v1.0.1 files). - Unblock the extracted files — right-click each
.dll→ Properties → Unblock, or runGet-ChildItem "<install path>" -Recurse | Unblock-Filein PowerShell. - Restart Clarion.
Full Changelog: v1.0.1...v1.0.2
v1.0.1
ClarionMarkdownEditor v1.0.0
Clarion Markdown Editor v1.0.0
A Markdown file viewer and editor addin for the Clarion IDE with split-pane live preview.
Features
- Tabbed multi-file editor with live preview
- Syntax highlighting via highlight.js
- Single instance design
- Dark mode sync with Clarion IDE theme
Fork of peterparker57/ClarionMarkdownEditor with improvements pending upstream PR.