feat: border around images

This commit is contained in:
hugeblank 2024-12-03 13:07:24 -08:00
parent 4051184fdb
commit 01edc270d2
2 changed files with 23 additions and 17 deletions

View file

@ -17,23 +17,23 @@ import type { Plugin } from "unified";
const customSchema = {
...defaultSchema,
attributes: {
...defaultSchema.attributes,
font: [...(defaultSchema.attributes?.font ?? []), 'color'],
blockquote: [
...(defaultSchema.attributes?.blockquote ?? []),
// bluesky
'className',
'dataBlueskyUri',
'dataBlueskyCid',
// instagram
'dataInstgrmCaptioned',
'dataInstgrmPermalink',
'dataInstgrmVersion'
],
iframe: [
'width', 'height', 'title', 'frameborder', 'allow', 'referrerpolicy', 'allowfullscreen', 'style', 'seamless',
['src', /https:\/\/(www.youtube.com|bandcamp.com)\/.*/]
],
...defaultSchema.attributes,
font: [...(defaultSchema.attributes?.font ?? []), 'color'],
blockquote: [
...(defaultSchema.attributes?.blockquote ?? []),
// bluesky
'className',
'dataBlueskyUri',
'dataBlueskyCid',
// instagram
'dataInstgrmCaptioned',
'dataInstgrmPermalink',
'dataInstgrmVersion'
],
iframe: [
'width', 'height', 'title', 'frameborder', 'allow', 'referrerpolicy', 'allowfullscreen', 'style', 'seamless',
['src', /https:\/\/(www.youtube.com|bandcamp.com)\/.*/]
],
section: ['dataFootnotes', 'className']
},
tagNames: [...(defaultSchema.tagNames ?? []), 'font', 'mark', 'iframe', 'section']

View file

@ -16,6 +16,12 @@ export default {
},
'[type="checkbox"]': {
'border-radius': '5px'
},
'img': {
'border-style': 'solid',
'border-color': 'gray',
'border-width': '1px',
'border-radius': '1em'
}
},
},