diff --git a/README.md b/README.md index af02fce..f542ad3 100644 --- a/README.md +++ b/README.md @@ -79,8 +79,23 @@ 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. + ### 0.7.2 - Use a bundle for the published JS library thanks to diff --git a/package.json b/package.json index c923e72..2c8d806 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@softwarefactory-project/re-ansi", - "version": "0.7.2", + "version": "0.7.4", "description": "ANSI code to HTML", "files": [ "README.md", 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")])]), ];