1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-25 07:31:49 +00:00

CommonMark

This commit is contained in:
Rokt33r
2016-01-06 04:41:19 +09:00
parent 15560a3bce
commit c8337c7287
11 changed files with 69 additions and 27 deletions

View File

@@ -56,7 +56,8 @@ export default class ArticleEditor extends React.Component {
}
render () {
if (this.props.mode === 'markdown' && this.state.status === PREVIEW_MODE) {
let showPreview = this.props.mode === 'markdown' && this.state.status === PREVIEW_MODE
if (showPreview) {
return (
<div className='ArticleEditor'>
<MarkdownPreview

View File

@@ -138,7 +138,9 @@ export default class ArticleNavigator extends React.Component {
<div key={modifiedArticle.key} onClick={e => this.handleUnsavedItemClick(combinedArticle)(e)} className={className}>
<div className='ArticleNavigator-unsaved-list-item-label'>
<ModeIcon mode={combinedArticle.mode}/>&nbsp;
{combinedArticle.title}
{combinedArticle.title.trim().length > 0
? combinedArticle.title
: <span className='ArticleNavigator-unsaved-list-item-label-untitled'>(Untitled)</span>}
</div>
<button onClick={e => this.handleUncacheButtonClick(combinedArticle)(e)} className='ArticleNavigator-unsaved-list-item-discard-button'><i className='fa fa-times'/></button>
</div>

View File

@@ -144,9 +144,8 @@ function remap (state) {
articles.sort((a, b) => {
let match = new Date(b.updatedAt) - new Date(a.updatedAt)
if (match === 0) match = new Date(b.createdAt) - new Date(a.createdAt)
if (match === 0) match = b.title.compare(a.title)
if (match === 0) match = b.key.compare(a.key)
if (match === 0) match = b.title.localeCompare(a.title)
if (match === 0) match = b.key.localeCompare(a.key)
return match
})
let allArticles = articles.slice()