slate-md-serializer 3.1.0 now escapes correctly
This commit is contained in:
parent
6fba8311f9
commit
fc1c4996fc
2 changed files with 2 additions and 10 deletions
|
@ -178,15 +178,7 @@ export default class MessageComposerInput extends React.Component {
|
|||
rules: [
|
||||
{
|
||||
serialize: (obj, children) => {
|
||||
if (obj.object === 'string') {
|
||||
// escape any MD in it. i have no idea why the serializer doesn't
|
||||
// do this already.
|
||||
// TODO: this can probably be more robust - it doesn't consider
|
||||
// indenting or lists for instance.
|
||||
return children.replace(/([*_~`+])/g, '\\$1')
|
||||
.replace(/^([>#\|])/mg, '\\$1');
|
||||
}
|
||||
else if (obj.object === 'inline') {
|
||||
if (obj.object === 'inline') {
|
||||
switch (obj.type) {
|
||||
case 'pill':
|
||||
return `[${ obj.data.get('completion') }](${ obj.data.get('href') })`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue