feat: markdown render for thread author
This commit is contained in:
@@ -7,6 +7,7 @@ import './Flows.css';
|
||||
import LazyLoad from './react-lazyload/src';
|
||||
import {AudioWidget} from './AudioWidget';
|
||||
import {TokenCtx, ReplyForm} from './UserAction';
|
||||
import renderMd from './Markdown'
|
||||
|
||||
import {API, THUHOLE_API_ROOT} from './flows_api';
|
||||
|
||||
@@ -129,7 +130,7 @@ class FlowItem extends PureComponent {
|
||||
|
||||
render() {
|
||||
let props=this.props;
|
||||
let parts=props.parts||split_text(props.info.text,[
|
||||
let parts=props.parts||split_text(renderMd(props.info.text),[
|
||||
['url_pid',URL_PID_RE],
|
||||
['url',URL_RE],
|
||||
['pid',PID_RE],
|
||||
|
||||
8
src/Markdown.js
Normal file
8
src/Markdown.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import MarkdownIt from 'markdown-it'
|
||||
|
||||
let md = new MarkdownIt({
|
||||
html: false,
|
||||
linkify: false // avoid collision with text_splitter.js
|
||||
})
|
||||
|
||||
export default (text) => md.render(text)
|
||||
Reference in New Issue
Block a user