Skip to content

Commit

Permalink
[GH-19] Add markdown support to Todos (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
larkox authored and hanzei committed Jan 13, 2020
1 parent a4ed527 commit 00bac63
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions webapp/src/components/sidebar_right/todo_items.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import PropTypes from 'prop-types';

import {makeStyleFromTheme, changeOpacity} from 'mattermost-redux/utils/theme_utils';

const PostUtils = window.PostUtils; // import the post utilities

const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

function ToDoItems(props) {
Expand All @@ -22,6 +24,9 @@ function ToDoItems(props) {
const formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
const formattedDate = month + ' ' + day + ', ' + year;

const htmlFormattedText = PostUtils.formatText(item.message);
const itemComponent = PostUtils.messageHtmlToComponent(htmlFormattedText);

return (
<div
key={item.id}
Expand All @@ -35,9 +40,7 @@ function ToDoItems(props) {
{'X'}
</a>
<div style={style.message}>
<strong>
{item.message}
</strong>
{itemComponent}
</div>
<div
className='light'
Expand Down

0 comments on commit 00bac63

Please sign in to comment.