diff --git a/.github/workflows/ci.marster.yml b/.github/workflows/ci.marster.yml index 70f0b696..a526b7a1 100644 --- a/.github/workflows/ci.marster.yml +++ b/.github/workflows/ci.marster.yml @@ -87,11 +87,23 @@ jobs: with: token: ${{ secrets.NPM_TOKEN }} package: ./package.json - - - name: Coveralls - uses: coverallsapp/github-action@master + + outputs: + successful: ${{steps.create_tag.outputs.successful }} + + github-package: + runs-on: ubuntu-18.04 + needs: build-deploy + if: needs.build-deploy.outputs.successful + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: - github-token: ${{ secrets.GITHUB_TOKEN }} + node-version: 16 + registry-url: https://npm.pkg.github.com + scope: '@uiwjs' + + - run: npm install - name: Modify @uiw/react-markdown-preview => @uiwjs/react-markdown-preview uses: jaywcjlove/github-action-package@main @@ -100,5 +112,6 @@ jobs: { "name": "@uiwjs/react-markdown-preview" } - run: npm publish + if: steps.create_tag.outputs.successful env: NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} \ No newline at end of file diff --git a/README.md b/README.md index d980342c..fc931dd9 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ React Markdown Preview [![Build and Deploy](https://github.com/uiwjs/react-markdown-preview/actions/workflows/ci.marster.yml/badge.svg)](https://github.com/uiwjs/react-markdown-preview/actions/workflows/ci.marster.yml) [![jsDelivr CDN](https://data.jsdelivr.com/v1/package/npm/@uiw/react-markdown-preview/badge?style=rounded)](https://www.jsdelivr.com/package/npm/@uiw/react-markdown-preview) [![Downloads](https://img.shields.io/npm/dm/@uiw/react-markdown-preview.svg?style=flat)](https://www.npmjs.com/package/@uiw/react-markdown-preview) -[![Coverage Status](https://coveralls.io/repos/github/uiwjs/react-markdown-preview/badge.svg?branch=master)](https://coveralls.io/github/uiwjs/react-markdown-preview?branch=master) +[![Coverage Status](https://uiwjs.github.io/react-markdown-preview/badge.svg)](https://uiwjs.github.io/react-markdown-preview/coverage/lcov-report/) [![npm version](https://img.shields.io/npm/v/@uiw/react-markdown-preview.svg)](https://www.npmjs.com/package/@uiw/react-markdown-preview) [![npm unpkg](https://img.shields.io/badge/Open%20in-unpkg-blue)](https://uiwjs.github.io/npm-unpkg/#/pkg/@uiw/react-markdown-preview/file/README.md) @@ -46,6 +46,33 @@ function Demo() { } ``` +## Disable Header links + +```js test:meta +import MarkdownPreview from '@uiw/react-markdown-preview'; + +const source = ` +## MarkdownPreview + +## Header 2 + +### Header 3 +`; + +function Demo() { + return ( + { + if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) { + parent.children = [parent.children[1]]; + } + }} + /> + ); +} +``` + ### Options Props ```typescript diff --git a/package.json b/package.json index f49fc39d..ec6d88e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@uiw/react-markdown-preview", - "version": "4.0.19", + "version": "4.0.20", "description": "React component preview markdown text in web browser. The minimal amount of CSS to replicate the GitHub Markdown style.", "homepage": "https://uiwjs.github.io/react-markdown-preview", "main": "lib/index.js", @@ -84,9 +84,9 @@ "kkt": "~7.2.0", "prettier": "^2.7.1", "pretty-quick": "~3.1.3", - "react": "~18.1.0", - "react-dom": "~18.1.0", - "react-test-renderer": "~18.1.0", + "react": "~18.2.0", + "react-dom": "~18.2.0", + "react-test-renderer": "~18.2.0", "tsbb": "~3.7.0" }, "eslintConfig": { diff --git a/src/tsconfig.json b/src/tsconfig.json index 8f33f9ef..7c0aaeb7 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -1,9 +1,7 @@ { "extends": "../tsconfig", "compilerOptions": { - "jsx": "react", "baseUrl": "./", - "emitDeclarationOnly": true, "noEmit": false } }