mirror of
https://github.com/jaywcjlove/wxmp.git
synced 2026-01-12 00:08:50 +08:00
style: modify image style.
This commit is contained in:
@@ -9,7 +9,7 @@ import { Context, themes } from '../../store/context';
|
||||
import data from '../../../README.md';
|
||||
|
||||
const Warpper = styled.div`
|
||||
height: calc(100vh - 2.8rem);
|
||||
height: calc(100vh - 2.9rem);
|
||||
`;
|
||||
|
||||
export const HomePage = () => {
|
||||
@@ -25,7 +25,7 @@ export const HomePage = () => {
|
||||
extensions={[EditorView.lineWrapping]}
|
||||
renderPreview={Preview}
|
||||
visible={true}
|
||||
height="calc(100vh - 4.9rem)"
|
||||
height="calc(100vh - 4.92rem)"
|
||||
/>
|
||||
</Warpper>
|
||||
);
|
||||
|
||||
@@ -90,8 +90,10 @@ export const footnotesLabel = (node: Element) => {
|
||||
}
|
||||
|
||||
export const imagesStyle = (node: Element, parent: Root | Element | null) => {
|
||||
if (parent?.type === 'element' && parent.tagName === 'p' && node?.type === 'element' && node.tagName === 'img') {
|
||||
parent.tagName = 'figure';
|
||||
if (parent?.type === 'element' && /(p|a)/.test(parent.tagName) && node?.type === 'element' && node.tagName === 'img') {
|
||||
if (parent.tagName === 'p') {
|
||||
parent.tagName = 'figure'
|
||||
}
|
||||
if (!parent.properties) parent.properties = {}
|
||||
parent.properties.className = ['image-warpper']
|
||||
if (!node.properties) node.properties = {}
|
||||
|
||||
Reference in New Issue
Block a user