From d4ad74bdf286fed8ba953e30cc53e8827a2761c5 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Thu, 4 Sep 2025 08:41:30 +0000 Subject: [PATCH 1/3] Better handle link detection Fixes: #5 --- src/Ansi.res | 2 +- tests/Spec.res | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Ansi.res b/src/Ansi.res index 2bc0d1f..1999f34 100644 --- a/src/Ansi.res +++ b/src/Ansi.res @@ -153,7 +153,7 @@ module AnsiCode = { // Link management module HttpLink = { - let linkRe = RegExp.fromString("^(http(s)?:\\/\\/[^\\s]+)"); + let linkRe = RegExp.fromString("^(http(s)?:\\/\\/[^\\)>\\s]+)"); let get = (txt: string): parser => linkRe diff --git a/tests/Spec.res b/tests/Spec.res index b4b4a00..eba515f 100644 --- a/tests/Spec.res +++ b/tests/Spec.res @@ -77,6 +77,18 @@ let spec = [ Link("http://example.com/test"), Text(" 200"), ]), + "get2: [Example text]()" + ->testParse([ + Text("get2: [Example text](<"), + Link("https://example.com"), + Text(">)"), + ]), + "get3: [Example text](https://example.com)" + ->testParse([ + Text("get3: [Example text]("), + Link("https://example.com"), + Text(")"), + ]), "bright: \x1b[90mtest\x1b[m" ->testParse([Text("bright: "), withBrightColor("grey", [Text("test")])]), ]; From 833b9fc9be8cc9f9c457bdbb05b812aa97c49c75 Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Thu, 4 Sep 2025 09:59:40 +0000 Subject: [PATCH 2/3] Prepare version 0.7.3 --- README.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af02fce..5ccf1e6 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,10 @@ Make sure to read about [React][reason-react] and [Reason][rescript-lang] too. ## Changes +### 0.7.3 + +- Better parse url. + ### 0.7.2 - Use a bundle for the published JS library thanks to diff --git a/package.json b/package.json index c923e72..a960ff6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@softwarefactory-project/re-ansi", - "version": "0.7.2", + "version": "0.7.3", "description": "ANSI code to HTML", "files": [ "README.md", From 333f7b9e56847a57efb1765a653b65c26d8987bc Mon Sep 17 00:00:00 2001 From: Tristan Cacqueray Date: Fri, 26 Sep 2025 08:24:47 +0000 Subject: [PATCH 3/3] Add release doc and bump version to 0.7.4 --- README.md | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ccf1e6..f542ad3 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,19 @@ Then build and run tests with `yarn test`. Make sure to read about [React][reason-react] and [Reason][rescript-lang] too. +To make a release: + +- Update the version number in packages.json +- Run `npm run build && npm run bundle` +- Then: `npm publish` +- Tag and push the commit + ## Changes +### 0.7.4 + +- Add the missing `Ansi.res.js` to the release. + ### 0.7.3 - Better parse url. diff --git a/package.json b/package.json index a960ff6..2c8d806 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@softwarefactory-project/re-ansi", - "version": "0.7.3", + "version": "0.7.4", "description": "ANSI code to HTML", "files": [ "README.md",