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