mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -04:00
Remove wider mode #999
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
f7be49bbc3
commit
0180c75e55
17 changed files with 15 additions and 125 deletions
|
@ -1,14 +0,0 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
.wider .markdown-body {
|
||||
max-width: 1500px;
|
||||
width: 100%;
|
||||
|
||||
&>.wider-possible {
|
||||
max-width: 1500px;
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { DomElement } from 'domhandler'
|
||||
import { ComponentReplacer } from '../ComponentReplacer'
|
||||
import './possible-wider-replacer.scss'
|
||||
|
||||
const enabledTags = ['img', 'app-youtube', 'app-vimeo', 'app-asciinema', 'app-pdf']
|
||||
|
||||
/**
|
||||
* This replacer doesn't actually replace something.
|
||||
* It just uses the ComponentReplacer-Class to get access to the DOM and
|
||||
* appends the "wider-possible" class to paragraphs with special content.
|
||||
*/
|
||||
export class PossibleWiderReplacer extends ComponentReplacer {
|
||||
public getReplacement (node: DomElement): (undefined) {
|
||||
if (node.name !== 'p') {
|
||||
return
|
||||
}
|
||||
if (!node.children || node.children.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
if (node.children.find((subNode) => subNode.name && enabledTags.includes(subNode.name))) {
|
||||
if (!node.attribs) {
|
||||
node.attribs = {}
|
||||
}
|
||||
|
||||
node.attribs.class = `${node.attribs.class ?? ''} wider-possible`
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue