♻️ (app)

This commit is contained in:
Julien Calixte
2023-08-14 14:08:10 +02:00
parent 111794a40b
commit c0182c7f57
24 changed files with 4281 additions and 2108 deletions

View File

@@ -15,7 +15,8 @@ export const markdownItPlugin = (
const regexp = RegExp('^' + regex.source, flags)
const parse = (state: any, silent: boolean) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const parse = (state: any, silent: boolean): boolean => {
const match = regexp.exec(state.src.slice(state.pos))
if (!match) {

View File

@@ -3,7 +3,7 @@ import { markdownItPlugin } from '@/utils/markdown/markdown-it-regexp'
export const twitterPlugin = markdownItPlugin(
/@\[tweet]\((.*?)\)/g,
(matches: RegExpExecArray[]) => {
const [_, tweetId] = matches
const [, tweetId] = matches
return `<span id="tweet-${tweetId}" data-tweet-id="${tweetId}" class="markdown-tweet"></span>`
}

View File

@@ -1,14 +1,14 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck
window.twttr = (function (d, s, id) {
let js,
fjs = d.getElementsByTagName(s)[0],
const fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {}
if (d.getElementById(id)) {
return t
}
js = d.createElement(s)
const js = d.createElement(s)
js.id = id
js.src = 'https://platform.twitter.com/widgets.js'
fjs.parentNode.insertBefore(js, fjs)