Compare commits

..
Author SHA1 Message Date
Ajay Bura a430c0dfd7 remove paragraph from markdown 2022-10-22 16:31:26 +05:30
Ajay Bura e850d48fc3 Fix #898, #897 2022-10-11 20:07:26 +05:30
11 changed files with 718 additions and 496 deletions

No files matched your search

+4 -4
View File
@@ -12,9 +12,9 @@ jobs:
PR_NUMBER: ${{github.event.number}}
steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3.0.2
- name: Setup node
uses: actions/setup-node@v3.5.1
uses: actions/setup-node@v3.5.0
with:
node-version: 17.9.0
cache: 'npm'
@@ -23,7 +23,7 @@ jobs:
- name: Build app
run: npm run build
- name: Upload artifact
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v3.1.0
with:
name: preview
path: dist
@@ -31,7 +31,7 @@ jobs:
- name: Save pr number
run: echo ${PR_NUMBER} > ./pr.txt
- name: Upload pr number
uses: actions/upload-artifact@v3.1.1
uses: actions/upload-artifact@v3.1.0
with:
name: pr
path: ./pr.txt
+3 -3
View File
@@ -13,7 +13,7 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Download pr number
uses: dawidd6/action-download-artifact@46b4ae883bf0726f5949d025d31cb62c7a5ac70c
uses: dawidd6/action-download-artifact@7847792dd435a50521b8e3bd3576dae7459d1fa8
with:
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
@@ -22,7 +22,7 @@ jobs:
id: pr
run: echo "::set-output name=id::$(<pr.txt)"
- name: Download artifact
uses: dawidd6/action-download-artifact@46b4ae883bf0726f5949d025d31cb62c7a5ac70c
uses: dawidd6/action-download-artifact@7847792dd435a50521b8e3bd3576dae7459d1fa8
with:
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
@@ -30,7 +30,7 @@ jobs:
path: dist
- name: Deploy to Netlify
id: netlify
uses: nwtgck/actions-netlify@ac1cb16858bada08a9c71a81240a85cfc3f72913
uses: nwtgck/actions-netlify@b7c1504e00c6b8a249d1848cc1b522a4865eed99
with:
publish-dir: dist
deploy-message: "Deploy PR ${{ steps.pr.outputs.id }}"
+2 -2
View File
@@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3.0.2
- name: Build Docker image
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v3.1.1
with:
context: .
push: false
+1 -1
View File
@@ -14,7 +14,7 @@ jobs:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3.0.2
- name: NPM Lockfile Changes
uses: codepunkt/npm-lockfile-changes@b40543471c36394409466fdb277a73a0856d7891
with:
+3 -3
View File
@@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3.0.2
- name: Setup node
uses: actions/setup-node@v3.5.1
uses: actions/setup-node@v3.5.0
with:
node-version: 17.9.0
cache: 'npm'
@@ -22,7 +22,7 @@ jobs:
- name: Build app
run: npm run build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@ac1cb16858bada08a9c71a81240a85cfc3f72913
uses: nwtgck/actions-netlify@b7c1504e00c6b8a249d1848cc1b522a4865eed99
with:
publish-dir: dist
deploy-message: "Dev deploy ${{ github.sha }}"
+10 -10
View File
@@ -10,9 +10,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3.0.2
- name: Setup node
uses: actions/setup-node@v3.5.1
uses: actions/setup-node@v3.5.0
with:
node-version: 17.9.0
cache: 'npm'
@@ -21,7 +21,7 @@ jobs:
- name: Build app
run: npm run build
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@ac1cb16858bada08a9c71a81240a85cfc3f72913
uses: nwtgck/actions-netlify@b7c1504e00c6b8a249d1848cc1b522a4865eed99
with:
publish-dir: dist
deploy-message: "Prod deploy ${{ github.ref_name }}"
@@ -64,31 +64,31 @@ jobs:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3.1.0
uses: actions/checkout@v3.0.2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.1.0
uses: docker/setup-qemu-action@v2.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.2.1
uses: docker/setup-buildx-action@v2.0.0
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
uses: docker/login-action@v2.0.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to the Container registry
uses: docker/login-action@v2.1.0
uses: docker/login-action@v2.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.1.1
uses: docker/metadata-action@v4.0.1
with:
images: |
${{ secrets.DOCKER_USERNAME }}/cinny
ghcr.io/${{ github.repository }}
- name: Build and push Docker image
uses: docker/build-push-action@v3.2.0
uses: docker/build-push-action@v3.1.1
with:
context: .
platforms: linux/amd64,linux/arm64
+1 -1
View File
@@ -10,7 +10,7 @@ RUN npm run build
## App
FROM nginx:1.23.2-alpine
FROM nginx:1.23.1-alpine
COPY --from=builder /src/dist /app
+1 -1
View File
@@ -1,9 +1,9 @@
{
"defaultHomeserver": 3,
"homeserverList": [
"converser.eu",
"envs.net",
"halogen.city",
"kde.org",
"matrix.org",
"mozilla.org"
],
+656 -450
View File
File diff suppressed because it is too large. Load diff
+13 -13
View File
@@ -15,10 +15,10 @@
"author": "Ajay Bura",
"license": "MIT",
"dependencies": {
"@fontsource/inter": "4.5.14",
"@fontsource/inter": "4.5.13",
"@fontsource/roboto": "4.5.8",
"@khanacademy/simple-markdown": "0.8.5",
"@matrix-org/olm": "3.2.13",
"@khanacademy/simple-markdown": "0.8.4",
"@matrix-org/olm": "3.2.12",
"@tippyjs/react": "4.2.6",
"babel-polyfill": "6.26.0",
"blurhash": "2.0.3",
@@ -29,26 +29,26 @@
"flux": "4.0.3",
"formik": "2.2.9",
"html-react-parser": "3.0.4",
"katex": "0.16.3",
"katex": "0.16.2",
"linkify-html": "4.0.2",
"linkifyjs": "4.0.2",
"matrix-js-sdk": "20.1.0",
"matrix-js-sdk": "20.0.2",
"prop-types": "15.8.1",
"react": "17.0.2",
"react-autosize-textarea": "7.1.0",
"react-blurhash": "0.2.0",
"react-blurhash": "0.1.3",
"react-dnd": "15.1.2",
"react-dnd-html5-backend": "15.1.3",
"react-dom": "17.0.2",
"react-google-recaptcha": "2.1.0",
"react-modal": "3.16.1",
"react-modal": "3.15.1",
"sanitize-html": "2.7.2",
"tippy.js": "6.3.7",
"twemoji": "14.0.2"
},
"devDependencies": {
"@babel/core": "7.19.6",
"@babel/preset-env": "7.19.4",
"@babel/core": "7.19.3",
"@babel/preset-env": "7.19.3",
"@babel/preset-react": "7.18.6",
"assert": "2.0.0",
"babel-loader": "8.2.5",
@@ -59,22 +59,22 @@
"crypto-browserify": "3.12.0",
"css-loader": "6.7.1",
"css-minimizer-webpack-plugin": "4.1.0",
"eslint": "8.26.0",
"eslint": "8.24.0",
"eslint-config-airbnb": "19.0.4",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jsx-a11y": "6.6.1",
"eslint-plugin-react": "7.31.10",
"eslint-plugin-react": "7.31.8",
"eslint-plugin-react-hooks": "4.6.0",
"html-loader": "4.2.0",
"html-webpack-plugin": "5.5.0",
"mini-css-extract-plugin": "2.6.1",
"path-browserify": "1.0.1",
"sass": "1.55.0",
"sass-loader": "13.1.0",
"sass-loader": "13.0.2",
"stream-browserify": "3.0.0",
"style-loader": "3.3.1",
"url": "0.11.0",
"util": "0.12.5",
"util": "0.12.4",
"webpack": "5.74.0",
"webpack-cli": "4.10.0",
"webpack-dev-server": "4.11.1",
+24 -8
View File
@@ -82,12 +82,22 @@ const plainRules = {
},
newline: {
...defaultRules.newline,
match: blockRegex(/^ *\n/),
plain: () => '\n',
html: () => '<br>',
},
paragraph: {
...defaultRules.paragraph,
plain: (node, output, state) => `${output(node.content, state)}\n\n`,
html: (node, output, state) => htmlTag('p', output(node.content, state)),
match: (source, state) => {
const endMatch = blockRegex(/^([^\n]*)\n*$/);
if (endMatch) {
state.end = true;
return endMatch(source, state);
}
return blockRegex(/^([^\n]*)\n?/)(source, state);
},
plain: (node, output, state) => `${output(node.content, state)}${state.end ? '' : '\n'}`,
html: (node, output, state) => `${output(node.content, state)}${state.end ? '' : '<br>'}`,
},
escape: {
...defaultRules.escape,
@@ -101,9 +111,7 @@ const plainRules = {
text: {
...defaultRules.text,
match: anyScopeRegex(/^[\s\S]+?(?=[^0-9A-Za-z\s\u00c0-\uffff]| *\n|\w+:\S|$)/),
plain: (node, _, state) => (state.kind === 'edit'
? node.content.replace(/(\*|_|!\[|\[|\|\||\$\$?)/g, '\\$1')
: node.content),
plain: (node) => node.content,
},
};
@@ -138,7 +146,15 @@ const markdownRules = {
},
blockQuote: {
...defaultRules.blockQuote,
plain: (node, output, state) => `> ${output(node.content, state).trim().replace(/\n/g, '\n> ')}\n\n`,
match: blockRegex(/^( *>[^\n]+(\n *>+[^\n]+)*\n?)+/),
parse: (capture, parse, state) => {
const content = capture[0].replace(/^ *> ?/gm, '');
return {
content: parse(`${content}`, state),
};
},
plain: (node, output, state) => `> ${output(node.content, state).trim().replace(/\n/g, '\n> ')}\n`,
html: (node, output, state) => htmlTag('blockquote', output(node.content, state)),
},
list: {
...defaultRules.list,
@@ -492,11 +508,11 @@ function render(content, state, plainOut, htmlOut) {
};
}
const plainParser = parserFor(plainRules);
const plainParser = parserFor(plainRules, { disableAutoBlockNewlines: true });
const plainPlainOut = outputFor(plainRules, 'plain');
const plainHtmlOut = outputFor(plainRules, 'html');
const mdParser = parserFor(markdownRules);
const mdParser = parserFor(markdownRules, { disableAutoBlockNewlines: true });
const mdPlainOut = outputFor(markdownRules, 'plain');
const mdHtmlOut = outputFor(markdownRules, 'html');