mirror of
https://github.com/owncast/owncast.git
synced 2024-10-10 19:16:02 +00:00
Markdown-Editor-LineWrapping (#3908)
* Markdown-Editor-LineWrapping * added lineWrapping to js and css editors --------- Co-authored-by: Gabe Kangas <gabek@real-ity.com>
This commit is contained in:
parent
7cdf18de99
commit
39e77dc2cc
@ -1,6 +1,6 @@
|
||||
import React, { useState, useEffect, useContext, FC } from 'react';
|
||||
import { Typography, Button } from 'antd';
|
||||
import CodeMirror from '@uiw/react-codemirror';
|
||||
import CodeMirror, { EditorView } from '@uiw/react-codemirror';
|
||||
import { bbedit } from '@uiw/codemirror-theme-bbedit';
|
||||
import { javascript } from '@codemirror/lang-javascript';
|
||||
|
||||
@ -98,7 +98,7 @@ export const EditCustomJavascript: FC = () => {
|
||||
placeholder="/* Enter custom Javascript here */"
|
||||
theme={bbedit}
|
||||
height="200px"
|
||||
extensions={[javascript()]}
|
||||
extensions={[javascript(), EditorView.lineWrapping]}
|
||||
onChange={onValueChange}
|
||||
/>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
// EDIT CUSTOM CSS STYLES
|
||||
import React, { useState, useEffect, useContext, FC } from 'react';
|
||||
import { Typography, Button } from 'antd';
|
||||
import CodeMirror from '@uiw/react-codemirror';
|
||||
import CodeMirror, { EditorView } from '@uiw/react-codemirror';
|
||||
import { bbedit } from '@uiw/codemirror-theme-bbedit';
|
||||
import { css } from '@codemirror/lang-css';
|
||||
|
||||
@ -101,7 +101,7 @@ export const EditCustomStyles: FC = () => {
|
||||
placeholder="/* Enter custom CSS here */"
|
||||
theme={bbedit}
|
||||
height="200px"
|
||||
extensions={[css()]}
|
||||
extensions={[css(), EditorView.lineWrapping]}
|
||||
onChange={onCSSValueChange}
|
||||
/>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useState, useContext, useEffect, FC } from 'react';
|
||||
import { Button, Modal, Typography } from 'antd';
|
||||
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
||||
import CodeMirror from '@uiw/react-codemirror';
|
||||
import CodeMirror, { EditorView } from '@uiw/react-codemirror';
|
||||
import { bbedit } from '@uiw/codemirror-theme-bbedit';
|
||||
import { languages } from '@codemirror/language-data';
|
||||
import {
|
||||
@ -241,7 +241,7 @@ export default function EditInstanceDetails() {
|
||||
onChange={value => {
|
||||
handleFieldChange({ fieldName: 'offlineMessage', value });
|
||||
}}
|
||||
extensions={[markdown({ base: markdownLanguage, codeLanguages: languages })]}
|
||||
extensions={[markdown({ base: markdownLanguage, codeLanguages: languages }), EditorView.lineWrapping]}
|
||||
/>
|
||||
</div>
|
||||
<div className="field-tip">
|
||||
|
@ -1,7 +1,7 @@
|
||||
// EDIT CUSTOM DETAILS ON YOUR PAGE
|
||||
import React, { useState, useEffect, useContext } from 'react';
|
||||
import { Typography, Button } from 'antd';
|
||||
import CodeMirror from '@uiw/react-codemirror';
|
||||
import CodeMirror, { EditorView } from '@uiw/react-codemirror';
|
||||
import { bbedit } from '@uiw/codemirror-theme-bbedit';
|
||||
import { markdown, markdownLanguage } from '@codemirror/lang-markdown';
|
||||
import { languages } from '@codemirror/language-data';
|
||||
@ -103,7 +103,7 @@ export default function EditPageContent() {
|
||||
theme={bbedit}
|
||||
height="200px"
|
||||
onChange={handleEditorChange}
|
||||
extensions={[markdown({ base: markdownLanguage, codeLanguages: languages })]}
|
||||
extensions={[markdown({ base: markdownLanguage, codeLanguages: languages }), EditorView.lineWrapping]}
|
||||
/>
|
||||
|
||||
<br />
|
||||
|
Loading…
x
Reference in New Issue
Block a user