Skip to content

Commit

Permalink
Merge pull request #22 from fsegurai/development
Browse files Browse the repository at this point in the history
upg/libraries version
  • Loading branch information
fsegurai authored Jun 24, 2024
2 parents e1ce97d + aedfe9b commit 8576d74
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 113 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Demo available @ [https://fsegurai.github.io/ngx-markdown](https://fsegurai.gith
To add ngx-markdown along with the required marked library to your `package.json` use the following commands.

```bash
npm install ngx-markdown marked@^12.0.0 --save
npm install ngx-markdown marked@^12.0.2 --save
```

### Syntax highlight
Expand All @@ -51,7 +51,7 @@ npm install ngx-markdown marked@^12.0.0 --save
To add [Prism.js](http://prismjs.com/) library to your `package.json` use the following command.

```bash
npm install prismjs@^1.28.0 --save
npm install prismjs@^1.29.0 --save
```

To activate [Prism.js](http://prismjs.com/) syntax highlight you will need to include...
Expand Down Expand Up @@ -248,7 +248,7 @@ Using `markdown` component and/or directive, you will be able to use the `emoji`
To add [KaTeX](https://katex.org/) library to your `package.json` use the following command.

```bash
npm install katex@^0.16.0 --save
npm install katex@^0.16.10 --save
```

To activate [KaTeX](https://katex.org/) math rendering you will need to include...
Expand Down Expand Up @@ -312,7 +312,7 @@ public options: KatexOptions = {
To add [Mermaid](https://mermaid-js.github.io/) library to your `package.json` use the following command.

```bash
npm install mermaid@^10.6.0 --save
npm install mermaid@^10.9.1 --save
```

To activate [Mermaid](https://mermaid-js.github.io/) diagramming and charting tool you will need to include...
Expand Down Expand Up @@ -567,7 +567,7 @@ imports: [

#### Sanitization

As of ngx-markdown v9.0.0 **sanitization is enabled by default** and uses Angular `DomSanitizer` with `SecurityContext.HTML` to avoid XSS vulnerabilities. The `SecurityContext` level can be changed using the `sanitize` property when configuring `MarkdownModule`.
As of ngx-markdown v17.0.0 **sanitization is enabled by default** and uses Angular `DomSanitizer` with `SecurityContext.HTML` to avoid XSS vulnerabilities. The `SecurityContext` level can be changed using the `sanitize` property when configuring `MarkdownModule`.

##### Using the `provideMarkdown` function

Expand Down
6 changes: 3 additions & 3 deletions demo/src/app/marked-options-factory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {MarkedOptions, MarkedRenderer} from 'ngx-markdown';
import {AnchorService} from '@shared/anchor';
import { MarkedOptions, MarkedRenderer } from 'ngx-markdown';
import { AnchorService } from '@shared/anchor';

export function markedOptionsFactory(anchorService: AnchorService): MarkedOptions {
const renderer = new MarkedRenderer();
Expand All @@ -9,5 +9,5 @@ export function markedOptionsFactory(anchorService: AnchorService): MarkedOption
return MarkedRenderer.prototype.link.call(renderer, anchorService.normalizeExternalUrl(href), title, text);
};

return {renderer};
return { renderer };
}
14 changes: 7 additions & 7 deletions demo/src/app/rerender/rerender.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {ChangeDetectionStrategy, Component, ElementRef, OnDestroy, OnInit} from '@angular/core';
import {FlexModule} from '@angular/flex-layout/flex';
import {FormsModule} from '@angular/forms';
import {MatFormFieldModule} from '@angular/material/form-field';
import {MatInputModule} from '@angular/material/input';
import {MarkdownComponent, MarkdownService} from 'ngx-markdown';
import {ScrollspyNavLayoutComponent} from '@shared/scrollspy-nav-layout';
import { ChangeDetectionStrategy, Component, ElementRef, OnDestroy, OnInit } from '@angular/core';
import { FlexModule } from '@angular/flex-layout/flex';
import { FormsModule } from '@angular/forms';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatInputModule } from '@angular/material/input';
import { MarkdownComponent, MarkdownService } from 'ngx-markdown';
import { ScrollspyNavLayoutComponent } from '@shared/scrollspy-nav-layout';

@Component({
selector: 'app-rerender',
Expand Down
12 changes: 6 additions & 6 deletions demo/src/app/shared/anchor/anchor.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {LocationStrategy, ViewportScroller} from '@angular/common';
import {Injectable} from '@angular/core';
import {ActivatedRoute, Router, UrlTree} from '@angular/router';
import { LocationStrategy, ViewportScroller } from '@angular/common';
import { Injectable } from '@angular/core';
import { ActivatedRoute, Router, UrlTree } from '@angular/router';

/**
* Service to handle links generated through markdown parsing.
Expand Down Expand Up @@ -31,7 +31,7 @@ import {ActivatedRoute, Router, UrlTree} from '@angular/router';
* }
* ```
*/
@Injectable({providedIn: 'root'})
@Injectable({ providedIn: 'root' })
export class AnchorService {

constructor(
Expand Down Expand Up @@ -68,7 +68,7 @@ export class AnchorService {
navigate(url: string, replaceUrl = false): void {
const urlTree = this.getUrlTree(url);
this.router.navigated = false;
void this.router.navigateByUrl(urlTree, {replaceUrl});
void this.router.navigateByUrl(urlTree, { replaceUrl });
}

/**
Expand Down Expand Up @@ -107,7 +107,7 @@ export class AnchorService {
private getUrlTree(url: string): UrlTree {
const urlPath = this.stripFragment(url) || this.stripFragment(this.router.url);
const urlFragment = this.router.parseUrl(url).fragment || undefined;
return this.router.createUrlTree([urlPath], {relativeTo: this.route, fragment: urlFragment});
return this.router.createUrlTree([urlPath], { relativeTo: this.route, fragment: urlFragment });
}

private isExternalUrl(url: string): boolean {
Expand Down
14 changes: 7 additions & 7 deletions lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fsegurai/ngx-markdown",
"version": "17.0.0-beta.15",
"version": "17.0.0-beta.16",
"description": "Angular library that uses marked to parse markdown to html combined with Prism.js for synthax highlights",
"homepage": "https://github.com/fsegurai/ngx-markdown",
"license": "MIT",
Expand All @@ -27,22 +27,22 @@
"clipboard.js"
],
"dependencies": {
"tslib": "^2.3.0"
"tslib": "^2.6.3"
},
"peerDependencies": {
"@angular/common": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/platform-browser": "^17.0.0",
"marked": ">= 9.0.0 < 13.0.0",
"rxjs": "^6.5.3 || ^7.4.0",
"zone.js": "~0.14.0"
"rxjs": "^>= 6.5.3 <= 7.8.1",
"zone.js": "~0.14.7"
},
"optionalDependencies": {
"clipboard": "^2.0.11",
"emoji-toolkit": "^8.0.0",
"katex": "^0.16.0",
"mermaid": "^10.6.0",
"prismjs": "^1.28.0"
"katex": "^0.16.10",
"mermaid": "^10.9.1",
"prismjs": "^1.29.0"
},
"sideEffects": false
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"gumshoejs": "^5.1.2",
"hammerjs": "~2.0.8",
"katex": "0.16.10",
"marked": "^12.0.0",
"marked": "12.0.2",
"marked-gfm-heading-id": "^3.1.3",
"mermaid": "^10.9.1",
"ngx-markdown": "file:lib",
Expand Down
98 changes: 14 additions & 84 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4441,13 +4441,6 @@ cose-base@^1.0.0:
dependencies:
layout-base "^1.0.0"

cose-base@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/cose-base/-/cose-base-2.2.0.tgz"
integrity sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g==
dependencies:
layout-base "^2.0.0"

cosmiconfig@^8.2.0:
version "8.3.6"
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-8.3.6.tgz#060a2b871d66dba6c8538ea1118ba1ac16f5fae3"
Expand Down Expand Up @@ -4574,21 +4567,6 @@ cytoscape-cose-bilkent@^4.1.0:
dependencies:
cose-base "^1.0.0"

cytoscape-fcose@^2.1.0:
version "2.2.0"
resolved "https://registry.npmjs.org/cytoscape-fcose/-/cytoscape-fcose-2.2.0.tgz"
integrity sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ==
dependencies:
cose-base "^2.2.0"

cytoscape@^3.23.0:
version "3.24.0"
resolved "https://registry.npmjs.org/cytoscape/-/cytoscape-3.24.0.tgz"
integrity sha512-W9fJMrAfr/zKFzDCpRR/wn6uoEQ7gfbJmxPK5DadXj69XyAhZYi1QXLOE+UXJfXVXxqGM1o1eeiIrtxrtB43zA==
dependencies:
heap "^0.2.6"
lodash "^4.17.21"

cytoscape@^3.28.1:
version "3.29.2"
resolved "https://registry.yarnpkg.com/cytoscape/-/cytoscape-3.29.2.tgz#c99f42513c80a75e2e94858add32896c860202ac"
Expand Down Expand Up @@ -5204,11 +5182,6 @@ electron-to-chromium@^1.4.535:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.578.tgz#7a3510f333bcd55e87882799ebeb7518d6ab4d95"
integrity sha512-V0ZhSu1BQZKfG0yNEL6Dadzik8E1vAzfpVOapdSiT9F6yapEJ3Bk+4tZ4SMPdWiUchCgnM/ByYtBzp5ntzDMIA==

elkjs@^0.8.2:
version "0.8.2"
resolved "https://registry.npmjs.org/elkjs/-/elkjs-0.8.2.tgz"
integrity sha512-L6uRgvZTH+4OF5NE/MBbzQx/WYpru1xCBE9respNj6qznEewGUIfhzmm7horWWxbNO2M0WckQypGctR8lH79xQ==

elkjs@^0.9.0:
version "0.9.3"
resolved "https://registry.yarnpkg.com/elkjs/-/elkjs-0.9.3.tgz#16711f8ceb09f1b12b99e971b138a8384a529161"
Expand Down Expand Up @@ -6502,11 +6475,6 @@ hdr-histogram-percentiles-obj@^3.0.0:
resolved "https://registry.npmjs.org/hdr-histogram-percentiles-obj/-/hdr-histogram-percentiles-obj-3.0.0.tgz"
integrity sha512-7kIufnBqdsBGcSZLPJwqHT3yhk1QTsSlFsVD3kx5ixH/AlgBs9yM1q6DPhXZ8f8gtdqgh7N7/5btRLpQsS2gHw==

heap@^0.2.6:
version "0.2.7"
resolved "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz"
integrity sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==

hosted-git-info@^7.0.0:
version "7.0.1"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-7.0.1.tgz#9985fcb2700467fecf7f33a4d4874e30680b5322"
Expand Down Expand Up @@ -7401,20 +7369,13 @@ karma@~6.4.3:
ua-parser-js "^0.7.30"
yargs "^16.1.1"

[email protected], katex@^0.16.9:
[email protected], katex@^0.16.10, katex@^0.16.9:
version "0.16.10"
resolved "https://registry.yarnpkg.com/katex/-/katex-0.16.10.tgz#6f81b71ac37ff4ec7556861160f53bc5f058b185"
integrity sha512-ZiqaC04tp2O5utMsl2TEZTXxa6WSC4yo0fv5ML++D3QZv/vx2Mct0mTlRx3O+uUkjfuAgOkzsCmq5MiUEsDDdA==
dependencies:
commander "^8.3.0"

katex@^0.16.0:
version "0.16.7"
resolved "https://registry.npmjs.org/katex/-/katex-0.16.7.tgz"
integrity sha512-Xk9C6oGKRwJTfqfIbtr0Kes9OSv6IFsuhFGc7tW4urlpMJtuh+7YhzU6YEG9n8gmWKcMAFzkp7nr+r69kV0zrA==
dependencies:
commander "^8.3.0"

khroma@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/khroma/-/khroma-2.0.0.tgz"
Expand Down Expand Up @@ -7448,11 +7409,6 @@ layout-base@^1.0.0:
resolved "https://registry.npmjs.org/layout-base/-/layout-base-1.0.2.tgz"
integrity sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg==

layout-base@^2.0.0:
version "2.0.1"
resolved "https://registry.npmjs.org/layout-base/-/layout-base-2.0.1.tgz"
integrity sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg==

lcov-parse@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz"
Expand Down Expand Up @@ -7698,16 +7654,16 @@ [email protected]:
once "~1.3.0"

marked-gfm-heading-id@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/marked-gfm-heading-id/-/marked-gfm-heading-id-3.1.3.tgz#7bcfea85901843baf214b96ccc4ff67581c972a9"
integrity sha512-A0cRU4PCueX/5m8VE4mT8uTQ36l3xMYRojz3Eqnk4BmUFZ0T+9Xhn2KvHcANP4qbhfOeuMrWJCTQbASIBR5xeg==
version "3.2.0"
resolved "https://registry.yarnpkg.com/marked-gfm-heading-id/-/marked-gfm-heading-id-3.2.0.tgz#d0344f786b4ab55415048260aad147f4e8e904b6"
integrity sha512-Xfxpr5lXLDLY10XqzSCA9l2dDaiabQUgtYM9hw8yunyVsB/xYBRpiic6BOiY/EAJw1ik1eWr1ET1HKOAPZBhXg==
dependencies:
github-slugger "^2.0.0"

marked@^12.0.0:
version "12.0.1"
resolved "https://registry.yarnpkg.com/marked/-/marked-12.0.1.tgz#8ab1eb15560c7cbe3b011074845d7ca6c4d392b0"
integrity sha512-Y1/V2yafOcOdWQCX0XpAKXzDakPOpn6U0YLxTJs3cww6VxOzZV1BTOOYWLvH3gX38cq+iLwljHHTnMtlDfg01Q==
[email protected].2:
version "12.0.2"
resolved "https://registry.yarnpkg.com/marked/-/marked-12.0.2.tgz#b31578fe608b599944c69807b00f18edab84647e"
integrity sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==

mdast-util-from-markdown@^1.3.0:
version "1.3.1"
Expand Down Expand Up @@ -7766,32 +7722,6 @@ merge2@^1.3.0, merge2@^1.4.1:
resolved "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==

mermaid@^10.6.0:
version "10.6.0"
resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-10.6.0.tgz#151af64fb7c6cf1f8a5c403c53c6151832268b87"
integrity sha512-Hcti+Q2NiWnb2ZCijSX89Bn2i7TCUwosBdIn/d+u63Sz7y40XU6EKMctT4UX4qZuZGfKGZpfOeim2/KTrdR7aQ==
dependencies:
"@braintree/sanitize-url" "^6.0.1"
"@types/d3-scale" "^4.0.3"
"@types/d3-scale-chromatic" "^3.0.0"
cytoscape "^3.23.0"
cytoscape-cose-bilkent "^4.1.0"
cytoscape-fcose "^2.1.0"
d3 "^7.4.0"
d3-sankey "^0.12.3"
dagre-d3-es "7.0.10"
dayjs "^1.11.7"
dompurify "^3.0.5"
elkjs "^0.8.2"
khroma "^2.0.0"
lodash-es "^4.17.21"
mdast-util-from-markdown "^1.3.0"
non-layered-tidy-tree-layout "^2.0.2"
stylis "^4.1.3"
ts-dedent "^2.2.0"
uuid "^9.0.0"
web-worker "^1.2.0"

mermaid@^10.9.1:
version "10.9.1"
resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-10.9.1.tgz#5f582c23f3186c46c6aa673e59eeb46d741b2ea6"
Expand Down Expand Up @@ -8345,15 +8275,15 @@ ng-packagr@^17.0.0:
esbuild "^0.19.0"

"ngx-markdown@file:lib":
version "17.0.0-beta.15"
version "17.0.0-beta.16"
dependencies:
tslib "^2.3.0"
tslib "^2.6.3"
optionalDependencies:
clipboard "^2.0.11"
emoji-toolkit "^8.0.0"
katex "^0.16.0"
mermaid "^10.6.0"
prismjs "^1.28.0"
katex "^0.16.10"
mermaid "^10.9.1"
prismjs "^1.29.0"

nice-napi@^1.0.2:
version "1.0.2"
Expand Down Expand Up @@ -9131,7 +9061,7 @@ pretty-format@^29.7.0:
ansi-styles "^5.0.0"
react-is "^18.0.0"

prismjs@^1.28.0, prismjs@^1.29.0:
prismjs@^1.29.0:
version "1.29.0"
resolved "https://registry.npmjs.org/prismjs/-/prismjs-1.29.0.tgz"
integrity sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==
Expand Down

0 comments on commit 8576d74

Please sign in to comment.