Skip to content

Releases: msarson/ClarionMarkdownEditor

v1.3.0 — Auto-refresh, remembered view preferences, and resizable panes

Choose a tag to compare

@msarson msarson released this 10 Aug 10:46

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

Choose a tag to compare

@msarson msarson released this 17 May 10:14

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 marked has been removed entirely, and marked.min.js is now bundled locally under Resources/ — no CDN dependency, works offline.
  • Configuration: gfm: true (GitHub-flavored extensions on), breaks: false (CommonMark behavior).
  • Mermaid rendering preserved via a code renderer override that maps ```mermaid fences 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.highlightElement auto-detected and applied speculative tinting. The post-processing selector now requires an explicit language-… class.
  • Dark-mode CSS specificity bug where the inline code background was winning over pre code, giving nested code blocks a mismatched background. Added a dark-mode-specific pre code rule.

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

Choose a tag to compare

@msarson msarson released this 17 May 09:09

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 as Introduction # instead of Introduction. 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 in markdown-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

Choose a tag to compare

@msarson msarson released this 15 May 20:35

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: hideStartPage was managing toolbar visibility with an inline style.display = 'flex', which beat the v1.1.0 .format-toolbar.hidden class added by applyFormatToolbarVisibility. applyFormatToolbarVisibility is now the single source of truth — it also considers isStartPageActive, and clears any stale inline display before toggling the class so class-based rules actually win.

Installation

  1. Extract the zip into {CLARION_PATH}\accessory\addins\MarkdownEditor\ (overwriting v1.1.0 files).
  2. Unblock the extracted files — right-click the zip → Properties → Unblock before extracting, or Get-ChildItem "<install path>" -Recurse | Unblock-File.
  3. Restart Clarion.

Full Changelog: v1.1.0...v1.1.1

v1.1.0 — Open Markdown from URL

Choose a tag to compare

@msarson msarson released this 15 May 19:41

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) — probe README.md on main, fall back to master
  • 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

    ![](images/foo.png) inside a fetched README resolves against the source URL. Relative .md link clicks open as new in-editor tabs. Absolute http(s) links open in the system browser via Process.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.Http added to project references (not in the SDK default for the WindowsDesktop SDK).
  • addTab / updateTabInfo JS signatures gained isReadOnly and baseUrl parameters; defaults preserve old-style calls.

Installation

  1. Extract the zip into {CLARION_PATH}\accessory\addins\MarkdownEditor\ (overwriting v1.0.2 files).
  2. Unblock the extracted files — right-click the zip → Properties → Unblock before extracting, or run Get-ChildItem "<install path>" -Recurse | Unblock-File in PowerShell.
  3. Restart Clarion.

Full Changelog: v1.0.2...v1.1.0

v1.0.2 - Save file corruption fix

Choose a tag to compare

@msarson msarson released this 14 May 19:56

Fixed

  • Saving silently corrupted any file containing <, backslashes, tabs, or non-ASCII characters (#1).

    WebView2.ExecuteScriptAsync returns 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 \uXXXX form. Both save paths (GetEditorContentAsync and GetTabContentFromJs) 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 \uXXXX surrogate pairs.

  • 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

  1. Extract the zip into {CLARION_PATH}\accessory\addins\MarkdownEditor\ (overwriting v1.0.1 files).
  2. Unblock the extracted files — right-click each .dll → Properties → Unblock, or run Get-ChildItem "<install path>" -Recurse | Unblock-File in PowerShell.
  3. Restart Clarion.

Full Changelog: v1.0.1...v1.0.2

v1.0.1

Choose a tag to compare

@msarson msarson released this 03 Mar 19:29

Add custom Markdown Editor icon in View menu and pad title

ClarionMarkdownEditor v1.0.0

Choose a tag to compare

@msarson msarson released this 03 Mar 17:08

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.