From f3148ed53cb5b283398278585c0d091f1f659565 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Wed, 7 Feb 2024 20:23:19 -0600 Subject: [PATCH] Fix Syntax Highlighting Update changelog to match PR target shifts. --- changelog.md | 33 ++++++++++++++++++++++--------- client/homebrew/editor/editor.jsx | 4 ++-- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/changelog.md b/changelog.md index 081bd85ea..fe3076059 100644 --- a/changelog.md +++ b/changelog.md @@ -80,7 +80,7 @@ pre { ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). -### Tuesday 07/11/2023 +### Tuesday 02/07/2024 {{ taskList @@ -88,22 +88,37 @@ For a full record of development, visit our [Github Page](https://github.com/nat * [x] Add user requested feature for definition lists with multiple definitions. -This implements issue [#2340](https://github.com/naturalcrit/homebrewery/issues/2340) by extending the existing syntax pattern. Additional definitions must be on the same line. +This implements issue [#2340](https://github.com/naturalcrit/homebrewery/issues/2340) by extending the existing syntax pattern. + +Multiple Definition Description (\) terms must go on the following line with a blank line between definition sets. Additionally, Descriptions may be multi-line, if desired. Multi-line descriptions will be concatenated into a single Description on render. + +The previous, inline system has not been removed, however, the two forms may not be intermixed. ``` -Dictionary Term :: Definition One :: Definition Two :: Definition Three +Dictionary Term +:: Definition One +:: Definition Two +:: Definition Three ``` Example: ``` -Egg::Came before the Chicken::Python Packaging Format::Over Easy isn't - Egg - Came before the Chicken - Python Packaging Format - Over Easy isn't +::Came before the Chicken +::Python Packaging Format +::Over +Easy +isn't ``` - +Results: +``` +
+
Egg
+
Came before the Chicken
+
Python Packaging Format
+
Over Easy isn't
+
+``` }} ### Friday 13/10/2023 - v3.10.0 diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 0d1378439..7a5f433f5 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -160,8 +160,8 @@ const Editor = createClass({ codeMirror.markText({ line: lineNumber, ch: match.indices[2][0] }, { line: lineNumber, ch: match.indices[2][1] }, { className: 'dd-highlight' }); const ddIndex = match.indices[2][0]; let colons = /::/g; - let colonMatches; - while((colonMatches = colons.exec(match[2])) !== null){ + let colonMatches = colons.exec(match[2]); + if(colonMatches !== null){ codeMirror.markText({ line: lineNumber, ch: colonMatches.index + ddIndex }, { line: lineNumber, ch: colonMatches.index + colonMatches[0].length + ddIndex }, { className: 'dl-colon-highlight'} ) } }