Skip to content

Commit

Permalink
Merge pull request #6924 from opengovsg/fix/revert-markdown-regex
Browse files Browse the repository at this point in the history
build: release 6.91.1 hotfix
  • Loading branch information
KenLSM authored Nov 23, 2023
2 parents d98f05c + e74904b commit c8f5f4f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v6.91.1](https://github.com/opengovsg/FormSG/compare/v6.91.0...v6.91.1)

- build: release v6.91.0 [`#6918`](https://github.com/opengovsg/FormSG/pull/6918)
- Revert "fix: refine regex to handle newlines after indentation groups" [`10955ed`](https://github.com/opengovsg/FormSG/commit/10955ed7bbac0fcb7872ab0b49be43ba3dd3acb5)

#### [v6.91.0](https://github.com/opengovsg/FormSG/compare/v6.90.0...v6.91.0)

> 21 November 2023

- fix(markdown): refine regex to handle newlines after indentation groups [`#6917`](https://github.com/opengovsg/FormSG/pull/6917)
- fix: omit isVisible property from webhook response [`#6907`](https://github.com/opengovsg/FormSG/pull/6907)
- feat: charts [`#6790`](https://github.com/opengovsg/FormSG/pull/6790)
- build: merge release 6.90.0 to develop [`#6914`](https://github.com/opengovsg/FormSG/pull/6914)
- build: release v6.90.0 [`#6913`](https://github.com/opengovsg/FormSG/pull/6913)
- chore: bump version to v6.91.0 [`b5a2144`](https://github.com/opengovsg/FormSG/commit/b5a2144403deb886e681499e09a8aca7aaa3baa6)

#### [v6.90.0](https://github.com/opengovsg/FormSG/compare/v6.89.2...v6.90.0)

Expand Down
20 changes: 1 addition & 19 deletions frontend/src/components/MarkdownText/MarkdownText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,7 @@ export const MarkdownText = ({
const processedRawString = useMemo(() => {
// Create new line nodes for every new line in raw string so new lines gets rendered.
if (multilineBreaks) {
/**
* Matching new lines that are not preceded by a token that indents.
*
* (?<!{regex}): negative lookbehind to ensure that the following regex does not match
*
* (-|\d+\.|\*): matching character tokens that indents
* -: "-"
* *: "*",
* \d+ : "1.", "2.", etc.
*
* \s: whitespace following the token, indentation groups must start with token followed by a whitespace character
*
* .*: any character, any number of times, this is the actual text content of the line
*
* \n: new line character
*
* \n: the new line character that we will want markdown to render as a new line
*/
return children.replace(/(?<!(-|\d+\.|\*)\s.*\n)\n/gi, '&nbsp; \n')
return children.replace(/\n/gi, '&nbsp; \n')
}
return children
}, [children, multilineBreaks])
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "FormSG",
"description": "Form Manager for Government",
"version": "6.91.0",
"version": "6.91.1",
"homepage": "https://form.gov.sg",
"authors": [
"FormSG <[email protected]>"
Expand Down

0 comments on commit c8f5f4f

Please sign in to comment.