Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1382 from matrix-org/t3chguy/sub-sup
Browse files Browse the repository at this point in the history
allow sending sub,sup and whitelist them on receive
  • Loading branch information
dbkr committed Sep 13, 2017
2 parents 8ad69ee + 39470c4 commit 49724cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/HtmlUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function processHtmlForSending(html: string): string {
* of that HTML.
*/
export function sanitizedHtmlNode(insaneHtml) {
const saneHtml = sanitizeHtml(insaneHtml, sanitizeHtmlParams);
const saneHtml = sanitizeHtml(insaneHtml, sanitizeHtmlParams);

return <div dangerouslySetInnerHTML={{ __html: saneHtml }} dir="auto" />;
}
Expand All @@ -152,7 +152,7 @@ const sanitizeHtmlParams = {
allowedTags: [
'font', // custom to matrix for IRC-style font coloring
'del', // for markdown
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol', 'sup', 'sub',
'nl', 'li', 'b', 'i', 'u', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'span', 'img',
],
Expand Down
2 changes: 1 addition & 1 deletion src/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
import commonmark from 'commonmark';
import escape from 'lodash/escape';

const ALLOWED_HTML_TAGS = ['del', 'u'];
const ALLOWED_HTML_TAGS = ['sub', 'sup', 'del', 'u'];

// These types of node are definitely text
const TEXT_NODES = ['text', 'softbreak', 'linebreak', 'paragraph', 'document'];
Expand Down

0 comments on commit 49724cd

Please sign in to comment.