1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Merge branch 'spellchecker' of https://github.com/ehhc/Boostnote into spellchecker

This commit is contained in:
ehhc
2018-11-12 17:36:36 +01:00
59 changed files with 1515 additions and 378 deletions

View File

@@ -72,6 +72,8 @@ export default class CodeEditor extends React.Component {
} }
} }
this.editorActivityHandler = () => this.handleEditorActivity() this.editorActivityHandler = () => this.handleEditorActivity()
this.turndownService = new TurndownService()
} }
handleSearch (msg) { handleSearch (msg) {

View File

@@ -6,6 +6,7 @@ import CodeEditor from 'browser/components/CodeEditor'
import MarkdownPreview from 'browser/components/MarkdownPreview' import MarkdownPreview from 'browser/components/MarkdownPreview'
import eventEmitter from 'browser/main/lib/eventEmitter' import eventEmitter from 'browser/main/lib/eventEmitter'
import { findStorage } from 'browser/lib/findStorage' import { findStorage } from 'browser/lib/findStorage'
import ConfigManager from 'browser/main/lib/ConfigManager'
class MarkdownEditor extends React.Component { class MarkdownEditor extends React.Component {
constructor (props) { constructor (props) {
@@ -18,7 +19,7 @@ class MarkdownEditor extends React.Component {
this.supportMdSelectionBold = [16, 17, 186] this.supportMdSelectionBold = [16, 17, 186]
this.state = { this.state = {
status: 'PREVIEW', status: props.config.editor.switchPreview === 'RIGHTCLICK' ? props.config.editor.delfaultStatus : 'PREVIEW',
renderValue: props.value, renderValue: props.value,
keyPressed: new Set(), keyPressed: new Set(),
isLocked: false isLocked: false
@@ -76,9 +77,7 @@ class MarkdownEditor extends React.Component {
handleContextMenu (e) { handleContextMenu (e) {
const { config } = this.props const { config } = this.props
if (config.editor.switchPreview === 'RIGHTCLICK') { if (config.editor.switchPreview === 'RIGHTCLICK') {
const newStatus = this.state.status === 'PREVIEW' const newStatus = this.state.status === 'PREVIEW' ? 'CODE' : 'PREVIEW'
? 'CODE'
: 'PREVIEW'
this.setState({ this.setState({
status: newStatus status: newStatus
}, () => { }, () => {
@@ -88,6 +87,10 @@ class MarkdownEditor extends React.Component {
this.refs.preview.focus() this.refs.preview.focus()
} }
eventEmitter.emit('topbar:togglelockbutton', this.state.status) eventEmitter.emit('topbar:togglelockbutton', this.state.status)
const newConfig = Object.assign({}, config)
newConfig.editor.delfaultStatus = newStatus
ConfigManager.set(newConfig)
}) })
} }
} }

View File

@@ -17,6 +17,7 @@ import copy from 'copy-to-clipboard'
import mdurl from 'mdurl' import mdurl from 'mdurl'
import exportNote from 'browser/main/lib/dataApi/exportNote' import exportNote from 'browser/main/lib/dataApi/exportNote'
import { escapeHtmlCharacters } from 'browser/lib/utils' import { escapeHtmlCharacters } from 'browser/lib/utils'
import yaml from 'js-yaml'
import context from 'browser/lib/context' import context from 'browser/lib/context'
import i18n from 'browser/lib/i18n' import i18n from 'browser/lib/i18n'
import fs from 'fs' import fs from 'fs'
@@ -331,9 +332,7 @@ export default class MarkdownPreview extends React.Component {
allowCustomCSS, allowCustomCSS,
customCSS customCSS
) )
let body = this.markdown.render( let body = this.markdown.render(noteContent)
escapeHtmlCharacters(noteContent, { detectCodeBlock: true })
)
const files = [this.GetCodeThemeLink(codeBlockTheme), ...CSS_FILES] const files = [this.GetCodeThemeLink(codeBlockTheme), ...CSS_FILES]
const attachmentsAbsolutePaths = attachmentManagement.getAbsolutePathsOfAttachmentsInContent( const attachmentsAbsolutePaths = attachmentManagement.getAbsolutePathsOfAttachmentsInContent(
noteContent, noteContent,
@@ -740,7 +739,6 @@ export default class MarkdownPreview extends React.Component {
el.addEventListener('click', this.linkClickHandler) el.addEventListener('click', this.linkClickHandler)
}) })
} catch (e) { } catch (e) {
console.error(e)
el.className = 'flowchart-error' el.className = 'flowchart-error'
el.innerHTML = 'Flowchart parse error: ' + e.message el.innerHTML = 'Flowchart parse error: ' + e.message
} }
@@ -761,7 +759,6 @@ export default class MarkdownPreview extends React.Component {
el.addEventListener('click', this.linkClickHandler) el.addEventListener('click', this.linkClickHandler)
}) })
} catch (e) { } catch (e) {
console.error(e)
el.className = 'sequence-error' el.className = 'sequence-error'
el.innerHTML = 'Sequence diagram parse error: ' + e.message el.innerHTML = 'Sequence diagram parse error: ' + e.message
} }
@@ -772,14 +769,21 @@ export default class MarkdownPreview extends React.Component {
this.refs.root.contentWindow.document.querySelectorAll('.chart'), this.refs.root.contentWindow.document.querySelectorAll('.chart'),
el => { el => {
try { try {
const chartConfig = JSON.parse(el.innerHTML) const format = el.attributes.getNamedItem('data-format').value
const chartConfig = format === 'yaml' ? yaml.load(el.innerHTML) : JSON.parse(el.innerHTML)
el.innerHTML = '' el.innerHTML = ''
var canvas = document.createElement('canvas')
const canvas = document.createElement('canvas')
el.appendChild(canvas) el.appendChild(canvas)
/* eslint-disable no-new */
new Chart(canvas, chartConfig) const height = el.attributes.getNamedItem('data-height')
if (height && height.value !== 'undefined') {
el.style.height = height.value + 'vh'
canvas.height = height.value + 'vh'
}
const chart = new Chart(canvas, chartConfig)
} catch (e) { } catch (e) {
console.error(e)
el.className = 'chart-error' el.className = 'chart-error'
el.innerHTML = 'chartjs diagram parse error: ' + e.message el.innerHTML = 'chartjs diagram parse error: ' + e.message
} }

View File

@@ -24,16 +24,19 @@ const TagElement = ({ tagName }) => (
/** /**
* @description Tag element list component. * @description Tag element list component.
* @param {Array|null} tags * @param {Array|null} tags
* @param {boolean} showTagsAlphabetically
* @return {React.Component} * @return {React.Component}
*/ */
const TagElementList = tags => { const TagElementList = (tags, showTagsAlphabetically) => {
if (!isArray(tags)) { if (!isArray(tags)) {
return [] return []
} }
const tagElements = tags.map(tag => TagElement({ tagName: tag })) if (showTagsAlphabetically) {
return _.sortBy(tags).map(tag => TagElement({ tagName: tag }))
return tagElements } else {
return tags.map(tag => TagElement({ tagName: tag }))
}
} }
/** /**
@@ -55,7 +58,8 @@ const NoteItem = ({
pathname, pathname,
storageName, storageName,
folderName, folderName,
viewType viewType,
showTagsAlphabetically
}) => ( }) => (
<div <div
styleName={isActive ? 'item--active' : 'item'} styleName={isActive ? 'item--active' : 'item'}
@@ -93,7 +97,7 @@ const NoteItem = ({
<div styleName='item-bottom'> <div styleName='item-bottom'>
<div styleName='item-bottom-tagList'> <div styleName='item-bottom-tagList'>
{note.tags.length > 0 {note.tags.length > 0
? TagElementList(note.tags) ? TagElementList(note.tags, showTagsAlphabetically)
: <span : <span
style={{ fontStyle: 'italic', opacity: 0.5 }} style={{ fontStyle: 'italic', opacity: 0.5 }}
styleName='item-bottom-tagList-empty' styleName='item-bottom-tagList-empty'

View File

@@ -7,18 +7,18 @@ import styles from './StorageList.styl'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
/** /**
* @param {Array} storgaeList * @param {Array} storageList
*/ */
const StorageList = ({storageList, isFolded}) => ( const StorageList = ({storageList, isFolded}) => (
<div styleName={isFolded ? 'storageList-folded' : 'storageList'}> <div styleName={isFolded ? 'storageList-folded' : 'storageList'}>
{storageList.length > 0 ? storageList : ( {storageList.length > 0 ? storageList : (
<div styleName='storgaeList-empty'>No storage mount.</div> <div styleName='storageList-empty'>No storage mount.</div>
)} )}
</div> </div>
) )
StorageList.propTypes = { StorageList.propTypes = {
storgaeList: PropTypes.arrayOf(PropTypes.element).isRequired storageList: PropTypes.arrayOf(PropTypes.element).isRequired
} }
export default CSSModules(StorageList, styles) export default CSSModules(StorageList, styles)

View File

@@ -25,7 +25,7 @@ const TagListItem = ({name, handleClickTagListItem, handleClickNarrowToTag, hand
<button styleName={isActive ? 'tagList-item-active' : 'tagList-item'} onClick={() => handleClickTagListItem(name)}> <button styleName={isActive ? 'tagList-item-active' : 'tagList-item'} onClick={() => handleClickTagListItem(name)}>
<span styleName='tagList-item-name'> <span styleName='tagList-item-name'>
{`# ${name}`} {`# ${name}`}
<span styleName='tagList-item-count'>{count}</span> <span styleName='tagList-item-count'>{count !== 0 ? count : ''}</span>
</span> </span>
</button> </button>
</div> </div>

View File

@@ -209,41 +209,39 @@ code
text-decoration none text-decoration none
margin-right 2px margin-right 2px
pre pre
padding 0.5em !important padding 0.5rem !important
border solid 1px #D1D1D1 border solid 1px #D1D1D1
border-radius 5px border-radius 5px
overflow-x auto overflow-x auto
margin 0 0 1em margin 0 0 1rem
display flex display flex
line-height 1.4em line-height 1.4em
&.flowchart, &.sequence, &.chart
display flex
justify-content center
background-color white
&.CodeMirror
height initial
flex-wrap wrap
&>code
flex 1
overflow-x auto
code code
background-color inherit background-color inherit
margin 0 margin 0
padding 0 padding 0
border none border none
border-radius 0 border-radius 0
&.CodeMirror
height initial
flex-wrap wrap
&>code
flex 1
overflow-x auto
&.mermaid svg
max-width 100% !important
&>span.filename &>span.filename
width 100% margin -0.5rem 100% 0.5rem -0.5rem
border-radius: 5px 0px 0px 0px padding 0.125rem 0.375rem
margin -8px 100% 8px -8px
padding 0px 6px
background-color #777; background-color #777;
color white color white
&:empty
display none
&>span.lineNumber &>span.lineNumber
display none display none
font-size 1em font-size 1em
padding 0.5em 0 padding 0.5rem 0
margin -0.5em 0.5em -0.5em -0.5em margin -0.5rem 0.5rem -0.5rem -0.5rem
border-right 1px solid border-right 1px solid
text-align right text-align right
border-top-left-radius 4px border-top-left-radius 4px
@@ -375,6 +373,49 @@ for name, val in admonition_types
color: val[color] color: val[color]
content: val[icon] content: val[icon]
dl
margin 2rem 0
padding 0
display flex
width 100%
flex-wrap wrap
align-items flex-start
border-bottom 1px solid borderColor
background-color tableHeadBgColor
dt
border-top 1px solid borderColor
font-weight bold
text-align right
overflow hidden
flex-basis 20%
padding 0.4rem 0.9rem
box-sizing border-box
dd
border-top 1px solid borderColor
flex-basis 80%
padding 0.4rem 0.9rem
min-height 2.5rem
background-color $ui-noteDetail-backgroundColor
box-sizing border-box
dd + dd
margin-left 20%
pre.fence
flex-wrap wrap
.chart, .flowchart, .mermaid, .sequence
display flex
justify-content center
background-color white
max-width 100%
flex-grow 1
canvas, svg
max-width 100% !important
themeDarkBackground = darken(#21252B, 10%) themeDarkBackground = darken(#21252B, 10%)
themeDarkText = #f9f9f9 themeDarkText = #f9f9f9
themeDarkBorder = lighten(themeDarkBackground, 20%) themeDarkBorder = lighten(themeDarkBackground, 20%)
@@ -425,6 +466,14 @@ body[data-theme="dark"]
kbd kbd
background-color themeDarkBorder background-color themeDarkBorder
color themeDarkText color themeDarkText
dl
border-color themeDarkBorder
background-color themeDarkTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color themeDarkPreview
themeSolarizedDarkTableOdd = $ui-solarized-dark-noteDetail-backgroundColor themeSolarizedDarkTableOdd = $ui-solarized-dark-noteDetail-backgroundColor
themeSolarizedDarkTableEven = darken($ui-solarized-dark-noteDetail-backgroundColor, 10%) themeSolarizedDarkTableEven = darken($ui-solarized-dark-noteDetail-backgroundColor, 10%)
@@ -452,6 +501,14 @@ body[data-theme="solarized-dark"]
border-color themeSolarizedDarkTableBorder border-color themeSolarizedDarkTableBorder
&:last-child &:last-child
border-right solid 1px themeSolarizedDarkTableBorder border-right solid 1px themeSolarizedDarkTableBorder
dl
border-color themeDarkBorder
background-color themeSolarizedDarkTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color $ui-solarized-dark-noteDetail-backgroundColor
themeMonokaiTableOdd = $ui-monokai-noteDetail-backgroundColor themeMonokaiTableOdd = $ui-monokai-noteDetail-backgroundColor
themeMonokaiTableEven = darken($ui-monokai-noteDetail-backgroundColor, 10%) themeMonokaiTableEven = darken($ui-monokai-noteDetail-backgroundColor, 10%)
@@ -481,6 +538,14 @@ body[data-theme="monokai"]
border-right solid 1px themeMonokaiTableBorder border-right solid 1px themeMonokaiTableBorder
kbd kbd
background-color themeDarkBackground background-color themeDarkBackground
dl
border-color themeDarkBorder
background-color themeMonokaiTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color $ui-monokai-noteDetail-backgroundColor
themeDraculaTableOdd = $ui-dracula-noteDetail-backgroundColor themeDraculaTableOdd = $ui-dracula-noteDetail-backgroundColor
themeDraculaTableEven = darken($ui-dracula-noteDetail-backgroundColor, 10%) themeDraculaTableEven = darken($ui-dracula-noteDetail-backgroundColor, 10%)
@@ -509,4 +574,12 @@ body[data-theme="dracula"]
&:last-child &:last-child
border-right solid 1px themeDraculaTableBorder border-right solid 1px themeDraculaTableBorder
kbd kbd
background-color themeDarkBackground background-color themeDarkBackground
dl
border-color themeDarkBorder
background-color themeDraculaTableHead
dt
border-color themeDarkBorder
dd
border-color themeDarkBorder
background-color $ui-dracula-noteDetail-backgroundColor

View File

@@ -11,9 +11,9 @@ function getRandomInt (min, max) {
} }
function getId () { function getId () {
var pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' const pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
var id = 'm-' let id = 'm-'
for (var i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
id += pool[getRandomInt(0, 16)] id += pool[getRandomInt(0, 16)]
} }
return id return id
@@ -21,16 +21,20 @@ function getId () {
function render (element, content, theme) { function render (element, content, theme) {
try { try {
const height = element.attributes.getNamedItem('data-height')
if (height && height.value !== 'undefined') {
element.style.height = height.value + 'vh'
}
let isDarkTheme = theme === 'dark' || theme === 'solarized-dark' || theme === 'monokai' || theme === 'dracula' let isDarkTheme = theme === 'dark' || theme === 'solarized-dark' || theme === 'monokai' || theme === 'dracula'
mermaidAPI.initialize({ mermaidAPI.initialize({
theme: isDarkTheme ? 'dark' : 'default', theme: isDarkTheme ? 'dark' : 'default',
themeCSS: isDarkTheme ? darkThemeStyling : '' themeCSS: isDarkTheme ? darkThemeStyling : '',
useMaxWidth: false
}) })
mermaidAPI.render(getId(), content, (svgGraph) => { mermaidAPI.render(getId(), content, (svgGraph) => {
element.innerHTML = svgGraph element.innerHTML = svgGraph
}) })
} catch (e) { } catch (e) {
console.error(e)
element.className = 'mermaid-error' element.className = 'mermaid-error'
element.innerHTML = 'mermaid diagram parse error: ' + e.message element.innerHTML = 'mermaid diagram parse error: ' + e.message
} }

View File

@@ -48,9 +48,13 @@ const languages = [
locale: 'pl' locale: 'pl'
}, },
{ {
name: 'Portuguese', name: 'Portuguese (PT-BR)',
locale: 'pt-BR' locale: 'pt-BR'
}, },
{
name: 'Portuguese (PT-PT)',
locale: 'pt-PT'
},
{ {
name: 'Russian', name: 'Russian',
locale: 'ru' locale: 'ru'
@@ -61,6 +65,9 @@ const languages = [
}, { }, {
name: 'Turkish', name: 'Turkish',
locale: 'tr' locale: 'tr'
}, {
name: 'Thai',
locale: 'th'
} }
] ]

View File

@@ -0,0 +1,232 @@
'use strict'
module.exports = function definitionListPlugin (md) {
var isSpace = md.utils.isSpace
// Search `[:~][\n ]`, returns next pos after marker on success
// or -1 on fail.
function skipMarker (state, line) {
let start = state.bMarks[line] + state.tShift[line]
const max = state.eMarks[line]
if (start >= max) { return -1 }
// Check bullet
const marker = state.src.charCodeAt(start++)
if (marker !== 0x7E/* ~ */ && marker !== 0x3A/* : */) { return -1 }
const pos = state.skipSpaces(start)
// require space after ":"
if (start === pos) { return -1 }
return start
}
function markTightParagraphs (state, idx) {
const level = state.level + 2
let i
let l
for (i = idx + 2, l = state.tokens.length - 2; i < l; i++) {
if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') {
state.tokens[i + 2].hidden = true
state.tokens[i].hidden = true
i += 2
}
}
}
function deflist (state, startLine, endLine, silent) {
var ch,
contentStart,
ddLine,
dtLine,
itemLines,
listLines,
listTokIdx,
max,
newEndLine,
nextLine,
offset,
oldDDIndent,
oldIndent,
oldLineMax,
oldParentType,
oldSCount,
oldTShift,
oldTight,
pos,
prevEmptyEnd,
tight,
token
if (silent) {
// quirk: validation mode validates a dd block only, not a whole deflist
if (state.ddIndent < 0) { return false }
return skipMarker(state, startLine) >= 0
}
nextLine = startLine + 1
if (nextLine >= endLine) { return false }
if (state.isEmpty(nextLine)) {
nextLine++
if (nextLine >= endLine) { return false }
}
if (state.sCount[nextLine] < state.blkIndent) { return false }
contentStart = skipMarker(state, nextLine)
if (contentStart < 0) { return false }
// Start list
listTokIdx = state.tokens.length
tight = true
token = state.push('dl_open', 'dl', 1)
token.map = listLines = [ startLine, 0 ]
//
// Iterate list items
//
dtLine = startLine
ddLine = nextLine
// One definition list can contain multiple DTs,
// and one DT can be followed by multiple DDs.
//
// Thus, there is two loops here, and label is
// needed to break out of the second one
//
/* eslint no-labels:0,block-scoped-var:0 */
OUTER:
for (;;) {
prevEmptyEnd = false
token = state.push('dt_open', 'dt', 1)
token.map = [ dtLine, dtLine ]
token = state.push('inline', '', 0)
token.map = [ dtLine, dtLine ]
token.content = state.getLines(dtLine, dtLine + 1, state.blkIndent, false).trim()
token.children = []
token = state.push('dt_close', 'dt', -1)
for (;;) {
token = state.push('dd_open', 'dd', 1)
token.map = itemLines = [ ddLine, 0 ]
pos = contentStart
max = state.eMarks[ddLine]
offset = state.sCount[ddLine] + contentStart - (state.bMarks[ddLine] + state.tShift[ddLine])
while (pos < max) {
ch = state.src.charCodeAt(pos)
if (isSpace(ch)) {
if (ch === 0x09) {
offset += 4 - offset % 4
} else {
offset++
}
} else {
break
}
pos++
}
contentStart = pos
oldTight = state.tight
oldDDIndent = state.ddIndent
oldIndent = state.blkIndent
oldTShift = state.tShift[ddLine]
oldSCount = state.sCount[ddLine]
oldParentType = state.parentType
state.blkIndent = state.ddIndent = state.sCount[ddLine] + 2
state.tShift[ddLine] = contentStart - state.bMarks[ddLine]
state.sCount[ddLine] = offset
state.tight = true
state.parentType = 'deflist'
newEndLine = ddLine
while (++newEndLine < endLine && (state.sCount[newEndLine] >= state.sCount[ddLine] || state.isEmpty(newEndLine))) {
}
oldLineMax = state.lineMax
state.lineMax = newEndLine
state.md.block.tokenize(state, ddLine, newEndLine, true)
state.lineMax = oldLineMax
// If any of list item is tight, mark list as tight
if (!state.tight || prevEmptyEnd) {
tight = false
}
// Item become loose if finish with empty line,
// but we should filter last element, because it means list finish
prevEmptyEnd = (state.line - ddLine) > 1 && state.isEmpty(state.line - 1)
state.tShift[ddLine] = oldTShift
state.sCount[ddLine] = oldSCount
state.tight = oldTight
state.parentType = oldParentType
state.blkIndent = oldIndent
state.ddIndent = oldDDIndent
token = state.push('dd_close', 'dd', -1)
itemLines[1] = nextLine = state.line
if (nextLine >= endLine) { break OUTER }
if (state.sCount[nextLine] < state.blkIndent) { break OUTER }
contentStart = skipMarker(state, nextLine)
if (contentStart < 0) { break }
ddLine = nextLine
// go to the next loop iteration:
// insert DD tag and repeat checking
}
if (nextLine >= endLine) { break }
dtLine = nextLine
if (state.isEmpty(dtLine)) { break }
if (state.sCount[dtLine] < state.blkIndent) { break }
ddLine = dtLine + 1
if (ddLine >= endLine) { break }
if (state.isEmpty(ddLine)) { ddLine++ }
if (ddLine >= endLine) { break }
if (state.sCount[ddLine] < state.blkIndent) { break }
contentStart = skipMarker(state, ddLine)
if (contentStart < 0) { break }
// go to the next loop iteration:
// insert DT and DD tags and repeat checking
}
// Finilize list
token = state.push('dl_close', 'dl', -1)
listLines[1] = nextLine
state.line = nextLine
// mark paragraphs tight if needed
if (tight) {
markTightParagraphs(state, listTokIdx)
}
return true
}
md.block.ruler.before('paragraph', 'deflist', deflist, { alt: [ 'paragraph', 'reference' ] })
}

View File

@@ -0,0 +1,132 @@
'use strict'
module.exports = function (md, renderers, defaultRenderer) {
const paramsRE = /^[ \t]*([\w+#-]+)?(?:\(((?:\s*\w[-\w]*(?:=(?:'(?:.*?[^\\])?'|"(?:.*?[^\\])?"|(?:[^'"][^\s]*)))?)*)\))?(?::([^:]*)(?::(\d+))?)?\s*$/
function fence (state, startLine, endLine) {
let pos = state.bMarks[startLine] + state.tShift[startLine]
let max = state.eMarks[startLine]
if (state.sCount[startLine] - state.blkIndent >= 4 || pos + 3 > max) {
return false
}
const marker = state.src.charCodeAt(pos)
if (!(marker === 96 || marker === 126)) {
return false
}
let mem = pos
pos = state.skipChars(pos, marker)
let len = pos - mem
if (len < 3) {
return false
}
const markup = state.src.slice(mem, pos)
const params = state.src.slice(pos, max)
let nextLine = startLine
let haveEndMarker = false
while (true) {
nextLine++
if (nextLine >= endLine) {
break
}
pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]
max = state.eMarks[nextLine]
if (pos < max && state.sCount[nextLine] < state.blkIndent) {
break
}
if (state.src.charCodeAt(pos) !== marker || state.sCount[nextLine] - state.blkIndent >= 4) {
continue
}
pos = state.skipChars(pos, marker)
if (pos - mem < len) {
continue
}
pos = state.skipSpaces(pos)
if (pos >= max) {
haveEndMarker = true
break
}
}
len = state.sCount[startLine]
state.line = nextLine + (haveEndMarker ? 1 : 0)
const parameters = {}
let langType = ''
let fileName = ''
let firstLineNumber = 1
let match = paramsRE.exec(params)
if (match) {
if (match[1]) {
langType = match[1]
}
if (match[3]) {
fileName = match[3]
}
if (match[4]) {
firstLineNumber = parseInt(match[4], 10)
}
if (match[2]) {
const params = match[2]
const regex = /(\w[-\w]*)(?:=(?:'(.*?[^\\])?'|"(.*?[^\\])?"|([^'"][^\s]*)))?/g
let name, value
while ((match = regex.exec(params))) {
name = match[1]
value = match[2] || match[3] || match[4] || null
const height = /^(\d+)h$/.exec(name)
if (height && !value) {
parameters.height = height[1]
} else {
parameters[name] = value
}
}
}
}
let token
if (renderers[langType]) {
token = state.push(`${langType}_fence`, 'div', 0)
} else {
token = state.push('_fence', 'code', 0)
}
token.langType = langType
token.fileName = fileName
token.firstLineNumber = firstLineNumber
token.parameters = parameters
token.content = state.getLines(startLine + 1, nextLine, len, true)
token.markup = markup
token.map = [startLine, state.line]
return true
}
md.block.ruler.before('fence', '_fence', fence, {
alt: ['paragraph', 'reference', 'blockquote', 'list']
})
for (const name in renderers) {
md.renderer.rules[`${name}_fence`] = (tokens, index) => renderers[name](tokens[index])
}
if (defaultRenderer) {
md.renderer.rules['_fence'] = (tokens, index) => defaultRenderer(tokens[index])
}
}

View File

@@ -2,6 +2,7 @@
import sanitizeHtml from 'sanitize-html' import sanitizeHtml from 'sanitize-html'
import { escapeHtmlCharacters } from './utils' import { escapeHtmlCharacters } from './utils'
import url from 'url'
module.exports = function sanitizePlugin (md, options) { module.exports = function sanitizePlugin (md, options) {
options = options || {} options = options || {}
@@ -14,7 +15,7 @@ module.exports = function sanitizePlugin (md, options) {
options options
) )
} }
if (state.tokens[tokenIdx].type === 'fence') { if (state.tokens[tokenIdx].type === '_fence') {
// escapeHtmlCharacters has better performance // escapeHtmlCharacters has better performance
state.tokens[tokenIdx].content = escapeHtmlCharacters( state.tokens[tokenIdx].content = escapeHtmlCharacters(
state.tokens[tokenIdx].content, state.tokens[tokenIdx].content,
@@ -25,7 +26,7 @@ module.exports = function sanitizePlugin (md, options) {
const inlineTokens = state.tokens[tokenIdx].children const inlineTokens = state.tokens[tokenIdx].children
for (let childIdx = 0; childIdx < inlineTokens.length; childIdx++) { for (let childIdx = 0; childIdx < inlineTokens.length; childIdx++) {
if (inlineTokens[childIdx].type === 'html_inline') { if (inlineTokens[childIdx].type === 'html_inline') {
inlineTokens[childIdx].content = sanitizeHtml( inlineTokens[childIdx].content = sanitizeInline(
inlineTokens[childIdx].content, inlineTokens[childIdx].content,
options options
) )
@@ -35,3 +36,89 @@ module.exports = function sanitizePlugin (md, options) {
} }
}) })
} }
const tagRegex = /<([A-Z][A-Z0-9]*)\s*((?:\s*[A-Z][A-Z0-9]*(?:=("|')(?:[^\3]+?)\3)?)*)\s*\/?>|<\/([A-Z][A-Z0-9]*)\s*>/i
const attributesRegex = /([A-Z][A-Z0-9]*)(?:=("|')([^\2]+?)\2)?/ig
function sanitizeInline (html, options) {
let match = tagRegex.exec(html)
if (!match) {
return ''
}
const { allowedTags, allowedAttributes, selfClosing, allowedSchemesAppliedToAttributes } = options
if (match[1] !== undefined) {
// opening tag
const tag = match[1].toLowerCase()
if (allowedTags.indexOf(tag) === -1) {
return ''
}
const attributes = match[2]
let attrs = ''
let name
let value
while ((match = attributesRegex.exec(attributes))) {
name = match[1].toLowerCase()
value = match[3]
if (allowedAttributes['*'].indexOf(name) !== -1 || (allowedAttributes[tag] && allowedAttributes[tag].indexOf(name) !== -1)) {
if (allowedSchemesAppliedToAttributes.indexOf(name) !== -1) {
if (naughtyHRef(value, options) || (tag === 'iframe' && name === 'src' && naughtyIFrame(value, options))) {
continue
}
}
attrs += ` ${name}`
if (match[2]) {
attrs += `="${value}"`
}
}
}
if (selfClosing.indexOf(tag) === -1) {
return '<' + tag + attrs + '>'
} else {
return '<' + tag + attrs + ' />'
}
} else {
// closing tag
if (allowedTags.indexOf(match[4].toLowerCase()) !== -1) {
return html
} else {
return ''
}
}
}
function naughtyHRef (href, options) {
// href = href.replace(/[\x00-\x20]+/g, '')
href = href.replace(/<\!\-\-.*?\-\-\>/g, '')
const matches = href.match(/^([a-zA-Z]+)\:/)
if (!matches) {
if (href.match(/^[\/\\]{2}/)) {
return !options.allowProtocolRelative
}
// No scheme
return false
}
const scheme = matches[1].toLowerCase()
return options.allowedSchemes.indexOf(scheme) === -1
}
function naughtyIFrame (src, options) {
try {
const parsed = url.parse(src, false, true)
return options.allowedIframeHostnames.index(parsed.hostname) === -1
} catch (e) {
return true
}
}

View File

@@ -28,32 +28,6 @@ class Markdown {
html: true, html: true,
xhtmlOut: true, xhtmlOut: true,
breaks: config.preview.breaks, breaks: config.preview.breaks,
highlight: function (str, lang) {
const delimiter = ':'
const langInfo = lang.split(delimiter)
const langType = langInfo[0]
const fileName = langInfo[1] || ''
const firstLineNumber = parseInt(langInfo[2], 10)
if (langType === 'flowchart') {
return `<pre class="flowchart">${str}</pre>`
}
if (langType === 'sequence') {
return `<pre class="sequence">${str}</pre>`
}
if (langType === 'chart') {
return `<pre class="chart">${str}</pre>`
}
if (langType === 'mermaid') {
return `<pre class="mermaid">${str}</pre>`
}
return '<pre class="code CodeMirror">' +
'<span class="filename">' + fileName + '</span>' +
createGutter(str, firstLineNumber) +
'<code class="' + langType + '">' +
str +
'</code></pre>'
},
sanitize: 'STRICT' sanitize: 'STRICT'
} }
@@ -106,7 +80,11 @@ class Markdown {
'iframe': ['src', 'width', 'height', 'frameborder', 'allowfullscreen'], 'iframe': ['src', 'width', 'height', 'frameborder', 'allowfullscreen'],
'input': ['type', 'id', 'checked'] 'input': ['type', 'id', 'checked']
}, },
allowedIframeHostnames: ['www.youtube.com'] allowedIframeHostnames: ['www.youtube.com'],
selfClosing: [ 'img', 'br', 'hr', 'input' ],
allowedSchemes: [ 'http', 'https', 'ftp', 'mailto' ],
allowedSchemesAppliedToAttributes: [ 'href', 'src', 'cite' ],
allowProtocolRelative: true
}) })
} }
@@ -149,10 +127,50 @@ class Markdown {
} }
}) })
this.md.use(require('markdown-it-kbd')) this.md.use(require('markdown-it-kbd'))
this.md.use(require('markdown-it-admonition'), {types: ['note', 'hint', 'attention', 'caution', 'danger', 'error']}) this.md.use(require('markdown-it-admonition'), {types: ['note', 'hint', 'attention', 'caution', 'danger', 'error']})
this.md.use(require('markdown-it-abbr'))
this.md.use(require('markdown-it-sub'))
this.md.use(require('markdown-it-sup'))
this.md.use(require('./markdown-it-deflist'))
this.md.use(require('./markdown-it-frontmatter')) this.md.use(require('./markdown-it-frontmatter'))
this.md.use(require('./markdown-it-fence'), {
chart: token => {
if (token.parameters.hasOwnProperty('yaml')) {
token.parameters.format = 'yaml'
}
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="chart" data-height="${token.parameters.height}" data-format="${token.parameters.format || 'json'}">${token.content}</div>
</pre>`
},
flowchart: token => {
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="flowchart" data-height="${token.parameters.height}">${token.content}</div>
</pre>`
},
mermaid: token => {
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="mermaid" data-height="${token.parameters.height}">${token.content}</div>
</pre>`
},
sequence: token => {
return `<pre class="fence" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
<div class="sequence" data-height="${token.parameters.height}">${token.content}</div>
</pre>`
}
}, token => {
return `<pre class="code CodeMirror" data-line="${token.map[0]}">
<span class="filename">${token.fileName}</span>
${createGutter(token.content, token.firstLineNumber)}
<code class="${token.langType}">${token.content}</code>
</pre>`
})
const deflate = require('markdown-it-plantuml/lib/deflate') const deflate = require('markdown-it-plantuml/lib/deflate')
this.md.use(require('markdown-it-plantuml'), '', { this.md.use(require('markdown-it-plantuml'), '', {
generateSource: function (umlCode) { generateSource: function (umlCode) {
@@ -253,9 +271,12 @@ class Markdown {
this.md.renderer.render = (tokens, options, env) => { this.md.renderer.render = (tokens, options, env) => {
tokens.forEach((token) => { tokens.forEach((token) => {
switch (token.type) { switch (token.type) {
case 'heading_open':
case 'paragraph_open':
case 'blockquote_open': case 'blockquote_open':
case 'dd_open':
case 'dt_open':
case 'heading_open':
case 'list_item_open':
case 'paragraph_open':
case 'table_open': case 'table_open':
token.attrPush(['data-line', token.map[0]]) token.attrPush(['data-line', token.map[0]])
} }

View File

@@ -348,7 +348,7 @@ class MarkdownNoteDetail extends React.Component {
} }
render () { render () {
const { data, location } = this.props const { data, location, config } = this.props
const { note, editorType } = this.state const { note, editorType } = this.state
const storageKey = note.storage const storageKey = note.storage
const folderKey = note.folder const folderKey = note.folder
@@ -399,6 +399,8 @@ class MarkdownNoteDetail extends React.Component {
<TagSelect <TagSelect
ref='tags' ref='tags'
value={this.state.note.tags} value={this.state.note.tags}
saveTagsAlphabetically={config.ui.saveTagsAlphabetically}
showTagsAlphabetically={config.ui.showTagsAlphabetically}
data={data} data={data}
onChange={this.handleUpdateTag.bind(this)} onChange={this.handleUpdateTag.bind(this)}
/> />

View File

@@ -354,12 +354,10 @@ class SnippetNoteDetail extends React.Component {
this.refs['code-' + this.state.snippetIndex].reload() this.refs['code-' + this.state.snippetIndex].reload()
if (this.visibleTabs.offsetWidth > this.allTabs.scrollWidth) { if (this.visibleTabs.offsetWidth > this.allTabs.scrollWidth) {
console.log('no need for arrows')
this.moveTabBarBy(0) this.moveTabBarBy(0)
} else { } else {
const lastTab = this.allTabs.lastChild const lastTab = this.allTabs.lastChild
if (lastTab.offsetLeft + lastTab.offsetWidth < this.visibleTabs.offsetWidth) { if (lastTab.offsetLeft + lastTab.offsetWidth < this.visibleTabs.offsetWidth) {
console.log('need to scroll')
const width = this.visibleTabs.offsetWidth const width = this.visibleTabs.offsetWidth
const newLeft = lastTab.offsetLeft + lastTab.offsetWidth - width const newLeft = lastTab.offsetLeft + lastTab.offsetWidth - width
this.moveTabBarBy(newLeft > 0 ? -newLeft : 0) this.moveTabBarBy(newLeft > 0 ? -newLeft : 0)
@@ -627,7 +625,6 @@ class SnippetNoteDetail extends React.Component {
} }
focusEditor () { focusEditor () {
console.log('code-' + this.state.snippetIndex)
this.refs['code-' + this.state.snippetIndex].focus() this.refs['code-' + this.state.snippetIndex].focus()
} }
@@ -759,6 +756,8 @@ class SnippetNoteDetail extends React.Component {
<TagSelect <TagSelect
ref='tags' ref='tags'
value={this.state.note.tags} value={this.state.note.tags}
saveTagsAlphabetically={config.ui.saveTagsAlphabetically}
showTagsAlphabetically={config.ui.showTagsAlphabetically}
data={data} data={data}
onChange={(e) => this.handleChange(e)} onChange={(e) => this.handleChange(e)}
/> />

View File

@@ -179,10 +179,10 @@ class TagSelect extends React.Component {
} }
render () { render () {
const { value, className } = this.props const { value, className, showTagsAlphabetically } = this.props
const tagList = _.isArray(value) const tagList = _.isArray(value)
? value.map((tag) => { ? (showTagsAlphabetically ? _.sortBy(value) : value).map((tag) => {
return ( return (
<span styleName='tag' <span styleName='tag'
key={tag} key={tag}

View File

@@ -1,26 +1,26 @@
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import React from 'react' import React from 'react'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import styles from './ToggleModeButton.styl' import styles from './ToggleModeButton.styl'
import i18n from 'browser/lib/i18n' import i18n from 'browser/lib/i18n'
const ToggleModeButton = ({ const ToggleModeButton = ({
onClick, editorType onClick, editorType
}) => ( }) => (
<div styleName='control-toggleModeButton'> <div styleName='control-toggleModeButton'>
<div styleName={editorType === 'SPLIT' ? 'active' : 'non-active'} onClick={() => onClick('SPLIT')}> <div styleName={editorType === 'SPLIT' ? 'active' : 'non-active'} onClick={() => onClick('SPLIT')}>
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '../resources/icon/icon-mode-markdown-off-active.svg' : ''} /> <img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '../resources/icon/icon-mode-markdown-off-active.svg' : ''} />
</div> </div>
<div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}> <div styleName={editorType === 'EDITOR_PREVIEW' ? 'active' : 'non-active'} onClick={() => onClick('EDITOR_PREVIEW')}>
<img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} /> <img styleName='item-star' src={editorType === 'EDITOR_PREVIEW' ? '' : '../resources/icon/icon-mode-split-on-active.svg'} />
</div> </div>
<span styleName='tooltip'>{i18n.__('Toggle Mode')}</span> <span styleName='tooltip'>{i18n.__('Toggle Mode')}</span>
</div> </div>
) )
ToggleModeButton.propTypes = { ToggleModeButton.propTypes = {
onClick: PropTypes.func.isRequired, onClick: PropTypes.func.isRequired,
editorType: PropTypes.string.Required editorType: PropTypes.string.Required
} }
export default CSSModules(ToggleModeButton, styles) export default CSSModules(ToggleModeButton, styles)

View File

@@ -80,7 +80,6 @@ class Main extends React.Component {
} }
}) })
.then(data => { .then(data => {
console.log(data)
store.dispatch({ store.dispatch({
type: 'ADD_STORAGE', type: 'ADD_STORAGE',
storage: data.storage, storage: data.storage,

View File

@@ -56,7 +56,6 @@ class NoteList extends React.Component {
super(props) super(props)
this.selectNextNoteHandler = () => { this.selectNextNoteHandler = () => {
console.log('fired next')
this.selectNextNote() this.selectNextNote()
} }
this.selectPriorNoteHandler = () => { this.selectPriorNoteHandler = () => {
@@ -616,7 +615,6 @@ class NoteList extends React.Component {
.catch((err) => { .catch((err) => {
console.error('Cannot Delete note: ' + err) console.error('Cannot Delete note: ' + err)
}) })
console.log('Notes were all deleted')
} else { } else {
if (!confirmDeleteNote(confirmDeletion, false)) return if (!confirmDeleteNote(confirmDeletion, false)) return
@@ -636,7 +634,6 @@ class NoteList extends React.Component {
}) })
}) })
AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE') AwsMobileAnalyticsConfig.recordDynamicCustomEvent('EDIT_NOTE')
console.log('Notes went to trash')
}) })
.catch((err) => { .catch((err) => {
console.error('Notes could not go to trash: ' + err) console.error('Notes could not go to trash: ' + err)
@@ -996,6 +993,7 @@ class NoteList extends React.Component {
folderName={this.getNoteFolder(note).name} folderName={this.getNoteFolder(note).name}
storageName={this.getNoteStorage(note).name} storageName={this.getNoteStorage(note).name}
viewType={viewType} viewType={viewType}
showTagsAlphabetically={config.ui.showTagsAlphabetically}
/> />
) )
} }

View File

@@ -20,6 +20,10 @@ import i18n from 'browser/lib/i18n'
import context from 'browser/lib/context' import context from 'browser/lib/context'
import { remote } from 'electron' import { remote } from 'electron'
function matchActiveTags (tags, activeTags) {
return _.every(activeTags, v => tags.indexOf(v) >= 0)
}
class SideNav extends React.Component { class SideNav extends React.Component {
// TODO: should not use electron stuff v0.7 // TODO: should not use electron stuff v0.7
@@ -202,12 +206,20 @@ class SideNav extends React.Component {
tagListComponent () { tagListComponent () {
const { data, location, config } = this.props const { data, location, config } = this.props
const relatedTags = this.getRelatedTags(this.getActiveTags(location.pathname), data.noteMap) const activeTags = this.getActiveTags(location.pathname)
const relatedTags = this.getRelatedTags(activeTags, data.noteMap)
let tagList = _.sortBy(data.tagNoteMap.map( let tagList = _.sortBy(data.tagNoteMap.map(
(tag, name) => ({ name, size: tag.size, related: relatedTags.has(name) }) (tag, name) => ({ name, size: tag.size, related: relatedTags.has(name) })
), ['name']).filter( ).filter(
tag => tag.size > 0 tag => tag.size > 0
) ), ['name'])
if (config.ui.enableLiveNoteCounts && activeTags.length !== 0) {
const notesTags = data.noteMap.map(note => note.tags)
tagList = tagList.map(tag => {
tag.size = notesTags.filter(tags => tags.includes(tag.name) && matchActiveTags(tags, activeTags)).length
return tag
})
}
if (config.sortTagsBy === 'COUNTER') { if (config.sortTagsBy === 'COUNTER') {
tagList = _.sortBy(tagList, item => (0 - item.size)) tagList = _.sortBy(tagList, item => (0 - item.size))
} }
@@ -306,7 +318,6 @@ class SideNav extends React.Component {
.catch((err) => { .catch((err) => {
console.error('Cannot Delete note: ' + err) console.error('Cannot Delete note: ' + err)
}) })
console.log('Trash emptied')
} }
handleFilterButtonContextMenu (event) { handleFilterButtonContextMenu (event) {

View File

@@ -45,7 +45,6 @@ function initAwsMobileAnalytics () {
if (getSendEventCond()) return if (getSendEventCond()) return
AWS.config.credentials.get((err) => { AWS.config.credentials.get((err) => {
if (!err) { if (!err) {
console.log('Cognito Identity ID: ' + AWS.config.credentials.identityId)
recordDynamicCustomEvent('APP_STARTED') recordDynamicCustomEvent('APP_STARTED')
recordStaticCustomEvent() recordStaticCustomEvent()
} }
@@ -58,7 +57,7 @@ function recordDynamicCustomEvent (type, options = {}) {
mobileAnalyticsClient.recordEvent(type, options) mobileAnalyticsClient.recordEvent(type, options)
} catch (analyticsError) { } catch (analyticsError) {
if (analyticsError instanceof ReferenceError) { if (analyticsError instanceof ReferenceError) {
console.log(analyticsError.name + ': ' + analyticsError.message) console.error(analyticsError.name + ': ' + analyticsError.message)
} }
} }
} }
@@ -71,7 +70,7 @@ function recordStaticCustomEvent () {
}) })
} catch (analyticsError) { } catch (analyticsError) {
if (analyticsError instanceof ReferenceError) { if (analyticsError instanceof ReferenceError) {
console.log(analyticsError.name + ': ' + analyticsError.message) console.error(analyticsError.name + ': ' + analyticsError.message)
} }
} }
} }

View File

@@ -44,9 +44,10 @@ export const DEFAULT_CONFIG = {
enableRulers: false, enableRulers: false,
rulers: [80, 120], rulers: [80, 120],
displayLineNumbers: true, displayLineNumbers: true,
switchPreview: 'BLUR', // Available value: RIGHTCLICK, BLUR switchPreview: 'BLUR', // 'BLUR', 'DBL_CLICK', 'RIGHTCLICK'
delfaultStatus: 'PREVIEW', // 'PREVIEW', 'CODE'
scrollPastEnd: false, scrollPastEnd: false,
type: 'SPLIT', type: 'SPLIT', // 'SPLIT', 'EDITOR_PREVIEW'
fetchUrlTitle: true, fetchUrlTitle: true,
enableTableEditor: false, enableTableEditor: false,
enableFrontMatterTitle: true, enableFrontMatterTitle: true,
@@ -203,7 +204,7 @@ function rewriteHotkey (config) {
const keys = [...Object.keys(config.hotkey)] const keys = [...Object.keys(config.hotkey)]
keys.forEach(key => { keys.forEach(key => {
config.hotkey[key] = config.hotkey[key].replace(/Cmd/g, 'Command') config.hotkey[key] = config.hotkey[key].replace(/Cmd/g, 'Command')
config.hotkey[key] = config.hotkey[key].replace(/Opt/g, 'Alt') config.hotkey[key] = config.hotkey[key].replace(/Opt\s/g, 'Option ')
}) })
return config return config
} }

View File

@@ -529,7 +529,6 @@ function handleAttachmentLinkPaste (storageKey, noteKey, linkText) {
return modifiedLinkText return modifiedLinkText
}) })
} else { } else {
console.log('One if the parameters was null -> Do nothing..')
return Promise.resolve(linkText) return Promise.resolve(linkText)
} }
} }

View File

@@ -14,7 +14,6 @@ function renameStorage (key, name) {
cachedStorageList = JSON.parse(localStorage.getItem('storages')) cachedStorageList = JSON.parse(localStorage.getItem('storages'))
if (!_.isArray(cachedStorageList)) throw new Error('invalid storages') if (!_.isArray(cachedStorageList)) throw new Error('invalid storages')
} catch (err) { } catch (err) {
console.log('error got')
console.error(err) console.error(err)
return Promise.reject(err) return Promise.reject(err)
} }

View File

@@ -31,13 +31,9 @@ function resolveStorageData (storageCache) {
const version = parseInt(storage.version, 10) const version = parseInt(storage.version, 10)
if (version >= 1) { if (version >= 1) {
if (version > 1) {
console.log('The repository version is newer than one of current app.')
}
return Promise.resolve(storage) return Promise.resolve(storage)
} }
console.log('Transform Legacy storage', storage.path)
return migrateFromV6Storage(storage.path) return migrateFromV6Storage(storage.path)
.then(() => storage) .then(() => storage)
} }

View File

@@ -9,7 +9,7 @@ function resolveStorageNotes (storage) {
notePathList = sander.readdirSync(notesDirPath) notePathList = sander.readdirSync(notesDirPath)
} catch (err) { } catch (err) {
if (err.code === 'ENOENT') { if (err.code === 'ENOENT') {
console.log(notesDirPath, ' doesn\'t exist.') console.error(notesDirPath, ' doesn\'t exist.')
sander.mkdirSync(notesDirPath) sander.mkdirSync(notesDirPath)
} else { } else {
console.warn('Failed to find note dir', notesDirPath, err) console.warn('Failed to find note dir', notesDirPath, err)

View File

@@ -12,7 +12,6 @@ function toggleStorage (key, isOpen) {
cachedStorageList = JSON.parse(localStorage.getItem('storages')) cachedStorageList = JSON.parse(localStorage.getItem('storages'))
if (!_.isArray(cachedStorageList)) throw new Error('invalid storages') if (!_.isArray(cachedStorageList)) throw new Error('invalid storages')
} catch (err) { } catch (err) {
console.log('error got')
console.error(err) console.error(err)
return Promise.reject(err) return Promise.reject(err)
} }

View File

@@ -14,7 +14,6 @@ function once (name, listener) {
} }
function emit (name, ...args) { function emit (name, ...args) {
console.log(name)
remote.getCurrentWindow().webContents.send(name, ...args) remote.getCurrentWindow().webContents.send(name, ...args)
} }

View File

@@ -14,14 +14,13 @@ nodeIpc.connectTo(
path.join(app.getPath('userData'), 'boostnote.service'), path.join(app.getPath('userData'), 'boostnote.service'),
function () { function () {
nodeIpc.of.node.on('error', function (err) { nodeIpc.of.node.on('error', function (err) {
console.log(err) console.error(err)
}) })
nodeIpc.of.node.on('connect', function () { nodeIpc.of.node.on('connect', function () {
console.log('Connected successfully')
ipcRenderer.send('config-renew', {config: ConfigManager.get()}) ipcRenderer.send('config-renew', {config: ConfigManager.get()})
}) })
nodeIpc.of.node.on('disconnect', function () { nodeIpc.of.node.on('disconnect', function () {
console.log('disconnected') return
}) })
} }
) )

View File

@@ -28,10 +28,20 @@ class HotkeyTab extends React.Component {
}}) }})
} }
this.handleSettingError = (err) => { this.handleSettingError = (err) => {
this.setState({keymapAlert: { if (
type: 'error', this.state.config.hotkey.toggleMain === '' ||
message: err.message != null ? err.message : i18n.__('An error occurred!') this.state.config.hotkey.toggleMode === ''
}}) ) {
this.setState({keymapAlert: {
type: 'success',
message: i18n.__('Successfully applied!')
}})
} else {
this.setState({keymapAlert: {
type: 'error',
message: err.message != null ? err.message : i18n.__('An error occurred!')
}})
}
} }
this.oldHotkey = this.state.config.hotkey this.oldHotkey = this.state.config.hotkey
ipc.addListener('APP_SETTING_DONE', this.handleSettingDone) ipc.addListener('APP_SETTING_DONE', this.handleSettingDone)

View File

@@ -71,6 +71,9 @@ class UiTab extends React.Component {
showCopyNotification: this.refs.showCopyNotification.checked, showCopyNotification: this.refs.showCopyNotification.checked,
confirmDeletion: this.refs.confirmDeletion.checked, confirmDeletion: this.refs.confirmDeletion.checked,
showOnlyRelatedTags: this.refs.showOnlyRelatedTags.checked, showOnlyRelatedTags: this.refs.showOnlyRelatedTags.checked,
showTagsAlphabetically: this.refs.showTagsAlphabetically.checked,
saveTagsAlphabetically: this.refs.saveTagsAlphabetically.checked,
enableLiveNoteCounts: this.refs.enableLiveNoteCounts.checked,
disableDirectWrite: this.refs.uiD2w != null disableDirectWrite: this.refs.uiD2w != null
? this.refs.uiD2w.checked ? this.refs.uiD2w.checked
: false : false
@@ -250,16 +253,6 @@ class UiTab extends React.Component {
{i18n.__('Show a confirmation dialog when deleting notes')} {i18n.__('Show a confirmation dialog when deleting notes')}
</label> </label>
</div> </div>
<div styleName='group-checkBoxSection'>
<label>
<input onChange={(e) => this.handleUIChange(e)}
checked={this.state.config.ui.showOnlyRelatedTags}
ref='showOnlyRelatedTags'
type='checkbox'
/>&nbsp;
{i18n.__('Show only related tags')}
</label>
</div>
{ {
global.process.platform === 'win32' global.process.platform === 'win32'
? <div styleName='group-checkBoxSection'> ? <div styleName='group-checkBoxSection'>
@@ -275,6 +268,52 @@ class UiTab extends React.Component {
</div> </div>
: null : null
} }
<div styleName='group-header2'>Tags</div>
<div styleName='group-checkBoxSection'>
<label>
<input onChange={(e) => this.handleUIChange(e)}
checked={this.state.config.ui.saveTagsAlphabetically}
ref='saveTagsAlphabetically'
type='checkbox'
/>&nbsp;
{i18n.__('Save tags of a note in alphabetical order')}
</label>
</div>
<div styleName='group-checkBoxSection'>
<label>
<input onChange={(e) => this.handleUIChange(e)}
checked={this.state.config.ui.showTagsAlphabetically}
ref='showTagsAlphabetically'
type='checkbox'
/>&nbsp;
{i18n.__('Show tags of a note in alphabetical order')}
</label>
</div>
<div styleName='group-checkBoxSection'>
<label>
<input onChange={(e) => this.handleUIChange(e)}
checked={this.state.config.ui.showOnlyRelatedTags}
ref='showOnlyRelatedTags'
type='checkbox'
/>&nbsp;
{i18n.__('Show only related tags')}
</label>
</div>
<div styleName='group-checkBoxSection'>
<label>
<input onChange={(e) => this.handleUIChange(e)}
checked={this.state.config.ui.enableLiveNoteCounts}
ref='enableLiveNoteCounts'
type='checkbox'
/>&nbsp;
{i18n.__('Enable live count of notes')}
</label>
</div>
<div styleName='group-header2'>Editor</div> <div styleName='group-header2'>Editor</div>
<div styleName='group-section'> <div styleName='group-section'>

View File

@@ -113,7 +113,6 @@ function data (state = defaultDataMap(), action) {
// If storage chanced, origin key must be discarded // If storage chanced, origin key must be discarded
if (originKey !== uniqueKey) { if (originKey !== uniqueKey) {
console.log('diffrent storage')
// From isStarred // From isStarred
if (originNote.isStarred) { if (originNote.isStarred) {
state.starredSet = new Set(state.starredSet) state.starredSet = new Set(state.starredSet)

View File

@@ -49,7 +49,7 @@ function startServer () {
} }
function startElectron () { function startElectron () {
spawn(electron, ['--hot', './index.js']) spawn(electron, ['--hot', './index.js'], { stdio: 'inherit' })
.on('close', () => { .on('close', () => {
server.close() server.close()
}) })

View File

@@ -1,28 +1,170 @@
(function(mod) { (function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../codemirror/lib/codemirror"), require("../codemirror/mode/gfm/gfm")) mod(require("../codemirror/lib/codemirror"), require("../codemirror/mode/gfm/gfm"), require("../codemirror/mode/yaml-frontmatter/yaml-frontmatter"))
else if (typeof define == "function" && define.amd) // AMD else if (typeof define == "function" && define.amd) // AMD
define(["../codemirror/lib/codemirror", "../codemirror/mode/gfm/gfm"], mod) define(["../codemirror/lib/codemirror", "../codemirror/mode/gfm/gfm", "../codemirror/mode/yaml-frontmatter/yaml-frontmatter"], mod)
else // Plain browser env else // Plain browser env
mod(CodeMirror) mod(CodeMirror)
})(function(CodeMirror) { })(function(CodeMirror) {
'use strict' 'use strict'
CodeMirror.defineMode('bfm', function(config, gfmConfig) { const fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]+)?(?:\(((?:\s*\w[-\w]*(?:=(?:'(?:.*?[^\\])?'|"(?:.*?[^\\])?"|(?:[^'"][^\s]*)))?)*)\))?(?::([^:]*)(?::(\d+))?)?\s*$/
const bfmOverlay = {
startState() { function getMode(name, params, config, cm) {
if (!name) {
return null
}
const parameters = {}
if (params) {
const regex = /(\w[-\w]*)(?:=(?:'(.*?[^\\])?'|"(.*?[^\\])?"|([^'"][^\s]*)))?/g
let match
while ((match = regex.exec(params))) {
parameters[match[1]] = match[2] || match[3] || match[4] || null
}
}
if (name === 'chart') {
name = parameters.hasOwnProperty('yaml') ? 'yaml' : 'json'
}
const found = CodeMirror.findModeByName(name)
if (!found) {
return null
}
if (CodeMirror.modes.hasOwnProperty(found.mode)) {
const mode = CodeMirror.getMode(config, found.mode)
return mode.name === 'null' ? null : mode
} else {
CodeMirror.requireMode(found.mode, () => {
cm.setOption('mode', cm.getOption('mode'))
})
}
}
CodeMirror.defineMode('bfm', function (config, baseConfig) {
baseConfig.name = 'yaml-frontmatter'
const baseMode = CodeMirror.getMode(config, baseConfig)
return {
startState: function() {
return { return {
baseState: CodeMirror.startState(baseMode),
basePos: 0,
baseCur: null,
overlayPos: 0,
overlayCur: null,
streamSeen: null,
fencedEndRE: null,
inTable: false, inTable: false,
rowIndex: 0 rowIndex: 0
} }
}, },
copyState(s) { copyState: function(s) {
return { return {
baseState: CodeMirror.copyState(baseMode, s.baseState),
basePos: s.basePos,
baseCur: null,
overlayPos: s.overlayPos,
overlayCur: null,
fencedMode: s.fencedMode,
fencedState: s.fencedMode ? CodeMirror.copyState(s.fencedMode, s.fencedState) : null,
fencedEndRE: s.fencedEndRE,
inTable: s.inTable, inTable: s.inTable,
rowIndex: s.rowIndex rowIndex: s.rowIndex
} }
}, },
token(stream, state) { token: function(stream, state) {
const initialPos = stream.pos
if (state.fencedEndRE && stream.match(state.fencedEndRE)) {
state.fencedEndRE = null
state.fencedMode = null
state.fencedState = null
stream.pos = initialPos
}
else {
if (state.fencedMode) {
return state.fencedMode.token(stream, state.fencedState)
}
const match = stream.match(fencedCodeRE, true)
if (match) {
state.fencedEndRE = new RegExp(match[1] + '+ *$')
state.fencedMode = getMode(match[2], match[3], config, stream.lineOracle.doc.cm)
if (state.fencedMode) {
state.fencedState = CodeMirror.startState(state.fencedMode)
}
stream.pos = initialPos
}
}
if (stream != state.streamSeen || Math.min(state.basePos, state.overlayPos) < stream.start) {
state.streamSeen = stream
state.basePos = state.overlayPos = stream.start
}
if (stream.start == state.basePos) {
state.baseCur = baseMode.token(stream, state.baseState)
state.basePos = stream.pos
}
if (stream.start == state.overlayPos) {
stream.pos = stream.start
state.overlayCur = this.overlayToken(stream, state)
state.overlayPos = stream.pos
}
stream.pos = Math.min(state.basePos, state.overlayPos)
if (state.overlayCur == null) {
return state.baseCur
}
else if (state.baseCur != null && state.combineTokens) {
return state.baseCur + ' ' + state.overlayCur
}
else {
return state.overlayCur
}
},
overlayToken: function(stream, state) {
state.combineTokens = false
if (state.fencedEndRE && stream.match(state.fencedEndRE)) {
state.fencedEndRE = null
state.localMode = null
state.localState = null
return null
}
if (state.localMode) {
return state.localMode.token(stream, state.localState) || ''
}
const match = stream.match(fencedCodeRE, true)
if (match) {
state.fencedEndRE = new RegExp(match[1] + '+ *$')
state.localMode = getMode(match[2], match[3], config, stream.lineOracle.doc.cm)
if (state.localMode) {
state.localState = CodeMirror.startState(state.localMode)
}
return null
}
state.combineTokens = true state.combineTokens = true
if (state.inTable) { if (state.inTable) {
@@ -55,14 +197,31 @@
stream.skipToEnd() stream.skipToEnd()
return null return null
}, },
blankLine(state) { electricChars: baseMode.electricChars,
innerMode: function(state) {
if (state.fencedMode) {
return {
mode: state.fencedMode,
state: state.fencedState
}
} else {
return {
mode: baseMode,
state: state.baseState
}
}
},
blankLine: function(state) {
state.inTable = false state.inTable = false
if (state.fencedMode) {
return state.fencedMode.blankLine && state.fencedMode.blankLine(state.fencedState)
} else {
return baseMode.blankLine(state.baseState)
}
} }
} }
}, 'yaml-frontmatter')
gfmConfig.name = 'gfm'
return CodeMirror.overlayMode(CodeMirror.getMode(config, gfmConfig), bfmOverlay)
})
CodeMirror.defineMIME('text/x-bfm', 'bfm') CodeMirror.defineMIME('text/x-bfm', 'bfm')

View File

@@ -59,7 +59,7 @@ updater.on('update-downloaded', (info) => {
}) })
updater.autoUpdater.on('error', (err) => { updater.autoUpdater.on('error', (err) => {
console.log(err) console.error(err)
}) })
ipc.on('update-app-confirm', function (event, msg) { ipc.on('update-app-confirm', function (event, msg) {

View File

@@ -7,13 +7,19 @@ const config = new Config()
const _ = require('lodash') const _ = require('lodash')
var showMenu = process.platform !== 'win32' var showMenu = process.platform !== 'win32'
const windowSize = config.get('windowsize') || { x: null, y: null, width: 1080, height: 720 } const windowSize = config.get('windowsize') || {
x: null,
y: null,
width: 1080,
height: 720
}
const mainWindow = new BrowserWindow({ const mainWindow = new BrowserWindow({
x: windowSize.x, x: windowSize.x,
y: windowSize.y, y: windowSize.y,
width: windowSize.width, width: windowSize.width,
height: windowSize.height, height: windowSize.height,
useContentSize: true,
minWidth: 500, minWidth: 500,
minHeight: 320, minHeight: 320,
autoHideMenuBar: showMenu, autoHideMenuBar: showMenu,

View File

@@ -99,8 +99,11 @@
<script src="../node_modules/codemirror/mode/xml/xml.js"></script> <script src="../node_modules/codemirror/mode/xml/xml.js"></script>
<script src="../node_modules/codemirror/mode/markdown/markdown.js"></script> <script src="../node_modules/codemirror/mode/markdown/markdown.js"></script>
<script src="../node_modules/codemirror/mode/gfm/gfm.js"></script> <script src="../node_modules/codemirror/mode/gfm/gfm.js"></script>
<script src="../node_modules/codemirror/mode/yaml/yaml.js"></script>
<script src="../node_modules/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js"></script>
<script src="../extra_scripts/boost/boostNewLineIndentContinueMarkdownList.js"></script> <script src="../extra_scripts/boost/boostNewLineIndentContinueMarkdownList.js"></script>
<script src="../extra_scripts/codemirror/mode/bfm/bfm.js"></script>
<script src="../extra_scripts/codemirror/addon/hyperlink/hyperlink.js"></script> <script src="../extra_scripts/codemirror/addon/hyperlink/hyperlink.js"></script>
<script src="../extra_scripts/codemirror/mode/bfm/bfm.js"></script> <script src="../extra_scripts/codemirror/mode/bfm/bfm.js"></script>

View File

@@ -145,6 +145,7 @@
"UserName": "Benutzername", "UserName": "Benutzername",
"Password": "Passwort", "Password": "Passwort",
"Russian": "Russisch", "Russian": "Russisch",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Befehlstaste(⌘)", "Command(⌘)": "Befehlstaste(⌘)",
"Editor Rulers": "Editor Trennline", "Editor Rulers": "Editor Trennline",
"Enable": "Aktiviert", "Enable": "Aktiviert",

View File

@@ -100,6 +100,7 @@
"The Boostnote Team": "The Boostnote Team", "The Boostnote Team": "The Boostnote Team",
"Support via OpenCollective": "Support via OpenCollective", "Support via OpenCollective": "Support via OpenCollective",
"Language": "Language", "Language": "Language",
"Default New Note": "Default New Note",
"English": "English", "English": "English",
"German": "German", "German": "German",
"French": "French", "French": "French",
@@ -156,6 +157,7 @@
"Password": "Password", "Password": "Password",
"Russian": "Russian", "Russian": "Russian",
"Hungarian": "Hungarian", "Hungarian": "Hungarian",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Command(⌘)", "Command(⌘)": "Command(⌘)",
"Add Storage": "Add Storage", "Add Storage": "Add Storage",
"Name": "Name", "Name": "Name",
@@ -178,6 +180,8 @@
"Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.", "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.",
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠", "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠",
"Disabled": "Disabled", "Disabled": "Disabled",
"Save tags of a note in alphabetical order": "Save tags of a note in alphabetical order",
"Enable live count of notes": "Enable live count of notes",
"Enable smart table editor": "Enable smart table editor", "Enable smart table editor": "Enable smart table editor",
"Snippet Default Language": "Snippet Default Language" "Snippet Default Language": "Snippet Default Language"
} }

View File

@@ -143,6 +143,7 @@
"Spanish": "Español", "Spanish": "Español",
"Unsaved Changes!": "¡Tienes que guardar!", "Unsaved Changes!": "¡Tienes que guardar!",
"Russian": "Ruso", "Russian": "Ruso",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Comando(⌘)", "Command(⌘)": "Comando(⌘)",
"Editor Rulers": "Reglas del editor", "Editor Rulers": "Reglas del editor",
"Enable": "Activar", "Enable": "Activar",

View File

@@ -146,6 +146,7 @@
"UserName": "نام کاربری", "UserName": "نام کاربری",
"Password": "رمز عبور", "Password": "رمز عبور",
"Russian": "روسی", "Russian": "روسی",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Command(⌘)", "Command(⌘)": "Command(⌘)",
"Editor Rulers": "Editor Rulers", "Editor Rulers": "Editor Rulers",
"Enable": "فعال", "Enable": "فعال",

View File

@@ -40,6 +40,7 @@
"Editor Indent Style": "Style d'indentation de l'éditeur", "Editor Indent Style": "Style d'indentation de l'éditeur",
"Spaces": "Espaces", "Spaces": "Espaces",
"Tabs": "Tabulations", "Tabs": "Tabulations",
"Show only related tags": "Afficher uniquement les tags associés",
"Switch to Preview": "Switcher vers l'aperçu", "Switch to Preview": "Switcher vers l'aperçu",
"When Editor Blurred": "Quand l'éditeur n'est pas sélectionné", "When Editor Blurred": "Quand l'éditeur n'est pas sélectionné",
"When Editor Blurred, Edit On Double Click": "Quand l'éditeur n'est pas sélectionné, éditer avec un double clic", "When Editor Blurred, Edit On Double Click": "Quand l'éditeur n'est pas sélectionné, éditer avec un double clic",
@@ -57,6 +58,7 @@
"Preview Font Family": "Police de l'aperçu", "Preview Font Family": "Police de l'aperçu",
"Code Block Theme": "Thème des blocs de code", "Code Block Theme": "Thème des blocs de code",
"Show line numbers for preview code blocks": "Montrer les numéros de lignes dans les blocs de code dans l'aperçu", "Show line numbers for preview code blocks": "Montrer les numéros de lignes dans les blocs de code dans l'aperçu",
"Enable smart quotes": "Activer les citations intelligentes",
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter", "LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter",
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter", "LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter", "LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
@@ -92,6 +94,7 @@
"The Boostnote Team": "Les mainteneurs de Boostnote", "The Boostnote Team": "Les mainteneurs de Boostnote",
"Support via OpenCollective": "Support via OpenCollective", "Support via OpenCollective": "Support via OpenCollective",
"Language": "Langues", "Language": "Langues",
"Default New Note": "Nouvelle note par défaut",
"English": "Anglais", "English": "Anglais",
"German": "Allemand", "German": "Allemand",
"French": "Français", "French": "Français",
@@ -114,8 +117,8 @@
"Default View": "Vue par défaut", "Default View": "Vue par défaut",
"Compressed View": "Vue compressée", "Compressed View": "Vue compressée",
"Search": "Chercher", "Search": "Chercher",
"Blog Type": "Blog Type", "Blog Type": "Type du blog",
"Blog Address": "Blog Address", "Blog Address": "Adresse du blog",
"Save": "Sauvegarder", "Save": "Sauvegarder",
"Auth": "Auth", "Auth": "Auth",
"Authentication Method": "Méthode d'Authentification", "Authentication Method": "Méthode d'Authentification",
@@ -133,6 +136,7 @@
"Albanian": "Albanais", "Albanian": "Albanais",
"Chinese (zh-CN)": "Chinois (zh-CN)", "Chinese (zh-CN)": "Chinois (zh-CN)",
"Chinese (zh-TW)": "Chinois (zh-TW)", "Chinese (zh-TW)": "Chinois (zh-TW)",
"Toggle Editor Mode": "Basculer en mode éditeur",
"Danish": "Danois", "Danish": "Danois",
"Japanese": "Japonais", "Japanese": "Japonais",
"Korean": "Coréen", "Korean": "Coréen",
@@ -142,6 +146,7 @@
"Spanish": "Espagnol", "Spanish": "Espagnol",
"Unsaved Changes!": "Il faut sauvegarder !", "Unsaved Changes!": "Il faut sauvegarder !",
"Russian": "Russe", "Russian": "Russe",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Command(⌘)", "Command(⌘)": "Command(⌘)",
"Editor Rulers": "Règles dans l'éditeur", "Editor Rulers": "Règles dans l'éditeur",
"Enable": "Activer", "Enable": "Activer",
@@ -153,8 +158,15 @@
"Allow dangerous html tags": "Accepter les tags html dangereux", "Allow dangerous html tags": "Accepter les tags html dangereux",
"Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convertir des flèches textuelles en jolis signes. ⚠ Cela va interferérer avec les éventuels commentaires HTML dans votre Markdown.", "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convertir des flèches textuelles en jolis signes. ⚠ Cela va interferérer avec les éventuels commentaires HTML dans votre Markdown.",
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Vous avez collé un lien qui référence une pièce-jointe qui n'a pas pu être récupéré dans le dossier de stockage de la note. Coller des liens qui font référence à des pièces-jointes ne fonctionne que si la source et la destination et la même. Veuillez plutôt utiliser du Drag & Drop ! ⚠", "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Vous avez collé un lien qui référence une pièce-jointe qui n'a pas pu être récupéré dans le dossier de stockage de la note. Coller des liens qui font référence à des pièces-jointes ne fonctionne que si la source et la destination et la même. Veuillez plutôt utiliser du Drag & Drop ! ⚠",
"Save tags of a note in alphabetical order": "Sauvegarder les tags d'une note en ordre alphabétique",
"Show tags of a note in alphabetical order": "Afficher les tags d'une note par ordre alphabétique",
"Enable live count of notes": "Activer le comptage live des notes",
"Enable smart table editor": "Activer l'intelligent éditeur de tableaux", "Enable smart table editor": "Activer l'intelligent éditeur de tableaux",
"Snippet Default Language": "Langage par défaut d'un snippet", "Snippet Default Language": "Langage par défaut d'un snippet",
"Disabled": "Disabled", "Disabled": "Disabled",
"New Snippet": "Nouveau snippet",
"Custom CSS": "CSS personnalisé",
"Snippet name": "Nom du snippet",
"Snippet prefix": "Préfixe du snippet"
"Delete Note": "Supprimer la note" "Delete Note": "Supprimer la note"
} }

View File

@@ -155,6 +155,7 @@
"Password": "Jelszo", "Password": "Jelszo",
"Russian": "Russian", "Russian": "Russian",
"Hungarian": "Hungarian", "Hungarian": "Hungarian",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Command(⌘)", "Command(⌘)": "Command(⌘)",
"Add Storage": "Tároló hozzáadása", "Add Storage": "Tároló hozzáadása",
"Name": "Név", "Name": "Név",

View File

@@ -146,6 +146,7 @@
"UserName": "UserName", "UserName": "UserName",
"Password": "Password", "Password": "Password",
"Russian": "Russo", "Russian": "Russo",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Comando(⌘)", "Command(⌘)": "Comando(⌘)",
"Editor Rulers": "Regole dell'editor", "Editor Rulers": "Regole dell'editor",
"Enable": "Abilita", "Enable": "Abilita",

View File

@@ -155,6 +155,7 @@
"Password": "パスワード", "Password": "パスワード",
"Russian": "ロシア語", "Russian": "ロシア語",
"Hungarian": "ハンガリー語", "Hungarian": "ハンガリー語",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "コマンド(⌘)", "Command(⌘)": "コマンド(⌘)",
"Add Storage": "ストレージを追加", "Add Storage": "ストレージを追加",
"Name": "名前", "Name": "名前",

View File

@@ -143,6 +143,7 @@
"Spanish": "Spanish", "Spanish": "Spanish",
"Unsaved Changes!": "저장해주세요!", "Unsaved Changes!": "저장해주세요!",
"Russian": "Russian", "Russian": "Russian",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Command(⌘)", "Command(⌘)": "Command(⌘)",
"Delete Folder": "폴더 삭제", "Delete Folder": "폴더 삭제",
"This will delete all notes in the folder and can not be undone.": "폴더의 모든 노트를 지우게 되고, 되돌릴 수 없습니다.", "This will delete all notes in the folder and can not be undone.": "폴더의 모든 노트를 지우게 되고, 되돌릴 수 없습니다.",

View File

@@ -143,6 +143,7 @@
"Spanish": "Spanish", "Spanish": "Spanish",
"Unsaved Changes!": "Unsaved Changes!", "Unsaved Changes!": "Unsaved Changes!",
"Russian": "Russian", "Russian": "Russian",
"Thai": "Thai (ภาษาไทย)",
"Editor Rulers": "Editor Rulers", "Editor Rulers": "Editor Rulers",
"Enable": "Enable", "Enable": "Enable",
"Disable": "Disable", "Disable": "Disable",

View File

@@ -149,6 +149,7 @@
"Spanish": "Hiszpański", "Spanish": "Hiszpański",
"Unsaved Changes!": "Musisz zapisać!", "Unsaved Changes!": "Musisz zapisać!",
"Russian": "Rosyjski", "Russian": "Rosyjski",
"Thai": "Thai (ภาษาไทย)",
"Editor Rulers": "Margines", "Editor Rulers": "Margines",
"Enable": "Włącz", "Enable": "Włącz",
"Disable": "Wyłącz", "Disable": "Wyłącz",

View File

@@ -143,6 +143,7 @@
"Spanish": "Espanhol", "Spanish": "Espanhol",
"Unsaved Changes!": "Você precisa salvar!", "Unsaved Changes!": "Você precisa salvar!",
"Russian": "Russo", "Russian": "Russo",
"Thai": "Thai (ภาษาไทย)",
"Editor Rulers": "Réguas do Editor", "Editor Rulers": "Réguas do Editor",
"Enable": "Habilitado", "Enable": "Habilitado",
"Disable": "Desabilitado", "Disable": "Desabilitado",

View File

@@ -1,156 +1,156 @@
{ {
"Notes": "Notes", "Notes": "Notas",
"Tags": "Tags", "Tags": "Etiquetas",
"Preferences": "Preferences", "Preferences": "Definiçōes",
"Make a note": "Make a note", "Make a note": "Criar nota",
"Ctrl": "Ctrl", "Ctrl": "Ctrl",
"Ctrl(^)": "Ctrl", "Ctrl(^)": "Ctrl",
"to create a new note": "to create a new note", "to create a new note": "para criar uma nova nota",
"Toggle Mode": "Toggle Mode", "Toggle Mode": "Alternar Modo",
"Trash": "Trash", "Trash": "Lixo",
"MODIFICATION DATE": "MODIFICATION DATE", "MODIFICATION DATE": "DATA DE MODIFICAÇÃO",
"Words": "Words", "Words": "Palavras",
"Letters": "Letters", "Letters": "Letras",
"STORAGE": "STORAGE", "STORAGE": "ARMAZENAMENTO",
"FOLDER": "FOLDER", "FOLDER": "PASTA",
"CREATION DATE": "CREATION DATE", "CREATION DATE": "DATA DE CRIAÇÃO",
"NOTE LINK": "NOTE LINK", "NOTE LINK": "ATALHO DE NOTA",
".md": ".md", ".md": ".md",
".txt": ".txt", ".txt": ".txt",
".html": ".html", ".html": ".html",
"Print": "Print", "Print": "Imprimir",
"Your preferences for Boostnote": "Your preferences for Boostnote", "Your preferences for Boostnote": "As tuas definiçōes para Boostnote",
"Storage Locations": "Storage Locations", "Storage Locations": "Locais de Armazenamento",
"Add Storage Location": "Add Storage Location", "Add Storage Location": "Adicionar Local de Armazenamento",
"Add Folder": "Add Folder", "Add Folder": "Adicionar Pasta",
"Open Storage folder": "Open Storage folder", "Open Storage folder": "Abrir Local de Armazenamento",
"Unlink": "Unlink", "Unlink": "Remover a ligação",
"Edit": "Edit", "Edit": "Editar",
"Delete": "Delete", "Delete": "Apagar",
"Interface": "Interface", "Interface": "Interface",
"Interface Theme": "Interface Theme", "Interface Theme": "Tema",
"Default": "Default", "Default": "Default",
"White": "White", "White": "Branco",
"Solarized Dark": "Solarized Dark", "Solarized Dark": "Solarized Dark",
"Dark": "Dark", "Dark": "Escuro",
"Show a confirmation dialog when deleting notes": "Show a confirmation dialog when deleting notes", "Show a confirmation dialog when deleting notes": "Mostrar uma confirmação ao excluir notas",
"Editor Theme": "Editor Theme", "Editor Theme": "Tema do Editor",
"Editor Font Size": "Editor Font Size", "Editor Font Size": "Tamanho de Fonte do Editor",
"Editor Font Family": "Editor Font Family", "Editor Font Family": "Família de Fonte do Editor",
"Editor Indent Style": "Editor Indent Style", "Editor Indent Style": "Estílo de Identação do Editor",
"Spaces": "Spaces", "Spaces": "Espaços",
"Tabs": "Tabs", "Tabs": "Tabs",
"Switch to Preview": "Switch to Preview", "Switch to Preview": "Mudar para Pré-Visualização",
"When Editor Blurred": "When Editor Blurred", "When Editor Blurred": "Quando o Editor Obscurece",
"When Editor Blurred, Edit On Double Click": "When Editor Blurred, Edit On Double Click", "When Editor Blurred, Edit On Double Click": "Quando o Editor Obscurece, Editar com Duplo Clique",
"On Right Click": "On Right Click", "On Right Click": "Ao Clicar Com o Botão Direito",
"Editor Keymap": "Editor Keymap", "Editor Keymap": "Mapa de Teclado do Editor",
"default": "default", "default": "padrão",
"vim": "vim", "vim": "vim",
"emacs": "emacs", "emacs": "emacs",
"⚠️ Please restart boostnote after you change the keymap": "⚠️ Please restart boostnote after you change the keymap", "⚠️ Please restart boostnote after you change the keymap": "⚠️ Por favor, reinicia o Boostnote depois de alterar o mapa de teclado.",
"Show line numbers in the editor": "Show line numbers in the editor", "Show line numbers in the editor": "Mostrar os números das linhas no editor",
"Allow editor to scroll past the last line": "Allow editor to scroll past the last line", "Allow editor to scroll past the last line": "Permitir que o editor faça scroll além da última linha",
"Bring in web page title when pasting URL on editor": "Bring in web page title when pasting URL on editor", "Bring in web page title when pasting URL on editor": "Trazer o título da página da Web ao colar o endereço no editor",
"Preview": "Preview", "Preview": "Pré-Visualização",
"Preview Font Size": "Preview Font Size", "Preview Font Size": "Tamanho da Fonte da Pré-Visualização",
"Preview Font Family": "Preview Font Family", "Preview Font Family": "Família da Fonte da Pré-Visualização",
"Code Block Theme": "Code Block Theme", "Code Block Theme": "Tema do Bloco de Código",
"Allow preview to scroll past the last line": "Allow preview to scroll past the last line", "Allow preview to scroll past the last line": "Permitir que se faça scroll além da última linha",
"Show line numbers for preview code blocks": "Show line numbers for preview code blocks", "Show line numbers for preview code blocks": "Mostrar os números das linhas na pré-visualização dos blocos de código",
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter", "LaTeX Inline Open Delimiter": "Delimitador para Abrir Bloco LaTeX em Linha",
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter", "LaTeX Inline Close Delimiter": "Delimitador para Fechar Bloco LaTeX em Linha",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter", "LaTeX Block Open Delimiter": "Delimitador para Abrir Bloco LaTeX",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter", "LaTeX Block Close Delimiter": "Delimitador para Fechar Bloco LaTeX",
"PlantUML Server": "PlantUML Server", "PlantUML Server": "PlantUML Server",
"Community": "Community", "Community": "Comunidade",
"Subscribe to Newsletter": "Subscribe to Newsletter", "Subscribe to Newsletter": "Subscrever à Newsletter",
"GitHub": "GitHub", "GitHub": "GitHub",
"Blog": "Blog", "Blog": "Blog",
"Facebook Group": "Facebook Group", "Facebook Group": "Grupo de Facebook",
"Twitter": "Twitter", "Twitter": "Twitter",
"About": "About", "About": "Sobre",
"Boostnote": "Boostnote", "Boostnote": "Boostnote",
"An open source note-taking app made for programmers just like you.": "An open source note-taking app made for programmers just like you.", "An open source note-taking app made for programmers just like you.": "Uma aplicação open source de bloco de notas feita para programadores como tu.",
"Website": "Website", "Website": "Website",
"Development": "Development", "Development": "Desenvolvimento",
" : Development configurations for Boostnote.": " : Development configurations for Boostnote.", " : Development configurations for Boostnote.": " : Configurações de desenvolvimento para o Boostnote.",
"Copyright (C) 2017 - 2018 BoostIO": "Copyright (C) 2017 - 2018 BoostIO", "Copyright (C) 2017 - 2018 BoostIO": "Direitos de Autor (C) 2017 - 2018 BoostIO",
"License: GPL v3": "License: GPL v3", "License: GPL v3": "Licença: GPL v3",
"Analytics": "Analytics", "Analytics": "Analíse de Data",
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.", "Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "O Boostnote coleta dados anônimos com o único propósito de melhorar a aplicação e não adquire informação pessoal ou conteúdo das tuas notas.",
"You can see how it works on ": "You can see how it works on ", "You can see how it works on ": "Podes ver como funciona em ",
"You can choose to enable or disable this option.": "You can choose to enable or disable this option.", "You can choose to enable or disable this option.": "Podes optar por activar ou desactivar esta opção.",
"Enable analytics to help improve Boostnote": "Enable analytics to help improve Boostnote", "Enable analytics to help improve Boostnote": "Permitir recolha de data anônima para ajudar a melhorar o Boostnote",
"Crowdfunding": "Crowdfunding", "Crowdfunding": "Financiamento Coletivo",
"Dear Boostnote users,": "Dear Boostnote users,", "Dear Boostnote users,": "Caros(as),",
"Thank you for using Boostnote!": "Thank you for using Boostnote!", "Thank you for using Boostnote!": "Obrigado por usar o Boostnote!",
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "Boostnote is used in about 200 different countries and regions by an awesome community of developers.", "Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "O Boostnote é usado em cerca de 200 países e regiões diferentes por uma incrível comunidade de developers.",
"To support our growing userbase, and satisfy community expectations,": "To support our growing userbase, and satisfy community expectations,", "To support our growing userbase, and satisfy community expectations,": "Para continuar a apoiar o crescimento e satisfazer as expectativas da comunidade,",
"we would like to invest more time and resources in this project.": "we would like to invest more time and resources in this project.", "we would like to invest more time and resources in this project.": "gostaríamos de investir mais tempo e recursos neste projeto.",
"If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!": "If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!", "If you use Boostnote and see its potential, help us out by supporting the project on OpenCollective!": "Se gostas deste projeto e vês o seu potencial, podes ajudar-nos através de donativos no OpenCollective!",
"Thanks,": "Thanks,", "Thanks,": "Obrigado,",
"The Boostnote Team": "The Boostnote Team", "The Boostnote Team": "A Equipa do Boostnote",
"Support via OpenCollective": "Support via OpenCollective", "Support via OpenCollective": "Suporte via OpenCollective",
"Language": "Language", "Language": "Idioma",
"English": "English", "English": "Inglês",
"German": "German", "German": "Alemão",
"French": "French", "French": "Francês",
"Show \"Saved to Clipboard\" notification when copying": "Show \"Saved to Clipboard\" notification when copying", "Show \"Saved to Clipboard\" notification when copying": "Mostrar a notificação \"Guardado na Área de Transferência\" ao copiar",
"All Notes": "All Notes", "All Notes": "Todas as Notas",
"Starred": "Starred", "Starred": "Com Estrela",
"Are you sure to ": "Are you sure to ", "Are you sure to ": "Tens a certeza que gostarias de ",
" delete": " delete", " delete": " apagar",
"this folder?": "this folder?", "this folder?": "esta pasta?",
"Confirm": "Confirm", "Confirm": "Confirmar",
"Cancel": "Cancel", "Cancel": "Cancelar",
"Markdown Note": "Markdown Note", "Markdown Note": "Nota em Markdown",
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.", "This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "Este formato permite a criação de documentos de texto. Estão disponíveis: listas de verificação, blocos de código e blocos Latex.",
"Snippet Note": "Snippet Note", "Snippet Note": "Fragmento de Nota",
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "This format is for creating code snippets. Multiple snippets can be grouped into a single note.", "This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "Este formato permite a criação de fragmentos de notas. Vários fragmentos podem ser agrupados em uma única nota.",
"Tab to switch format": "Tab to switch format", "Tab to switch format": "Tab para mudar o formato",
"Updated": "Updated", "Updated": "Actualizado",
"Created": "Created", "Created": "Criado",
"Alphabetically": "Alphabetically", "Alphabetically": "Alfabeticamente",
"Default View": "Default View", "Default View": "Vista Padrão",
"Compressed View": "Compressed View", "Compressed View": "Vista Comprimida",
"Search": "Search", "Search": "Procurar",
"Blog Type": "Blog Type", "Blog Type": "Tipo de Blog",
"Blog Address": "Blog Address", "Blog Address": "Endereço do Blog",
"Save": "Save", "Save": "Guardar",
"Auth": "Auth", "Auth": "Autenticação",
"Authentication Method": "Authentication Method", "Authentication Method": "Método de Autenticação",
"JWT": "JWT", "JWT": "JWT",
"USER": "USER", "USER": "USER",
"Token": "Token", "Token": "Token",
"Storage": "Storage", "Storage": "Armazenamento",
"Hotkeys": "Hotkeys", "Hotkeys": "Teclas de Atalho",
"Show/Hide Boostnote": "Show/Hide Boostnote", "Show/Hide Boostnote": "Mostrar/Esconder Boostnote",
"Restore": "Restore", "Restore": "Restaurar",
"Permanent Delete": "Permanent Delete", "Permanent Delete": "Apagar Permanentemente",
"Confirm note deletion": "Confirm note deletion", "Confirm note deletion": "Confirmar o apagamento da nota",
"This will permanently remove this note.": "This will permanently remove this note.", "This will permanently remove this note.": "Isto irá remover permanentemente esta nota.",
"Successfully applied!": "Successfully applied!", "Successfully applied!": "Aplicado com Sucesso!",
"Albanian": "Albanian", "Albanian": "Albanês",
"Chinese (zh-CN)": "Chinese (zh-CN)", "Chinese (zh-CN)": "Chinês (zh-CN)",
"Chinese (zh-TW)": "Chinese (zh-TW)", "Chinese (zh-TW)": "Chinês (zh-TW)",
"Danish": "Danish", "Danish": "Dinamarquês",
"Japanese": "Japanese", "Japanese": "Japonês",
"Korean": "Korean", "Korean": "Coreano",
"Norwegian": "Norwegian", "Norwegian": "Norueguês",
"Polish": "Polish", "Polish": "Polaco",
"Portuguese": "Portuguese", "Portuguese": "Português (pt-PT)",
"Spanish": "Spanish", "Spanish": "Espanhol",
"Unsaved Changes!": "Unsaved Changes!", "Unsaved Changes!": "Alterações Não Guardadas!",
"Russian": "Russian", "Russian": "Russo",
"Editor Rulers": "Editor Rulers", "Editor Rulers": "Réguas do Editor",
"Enable": "Enable", "Enable": "Activar",
"Disable": "Disable", "Disable": "Desactivar",
"Sanitization": "Sanitization", "Sanitization": "Sanitização",
"Only allow secure html tags (recommended)": "Only allow secure html tags (recommended)", "Only allow secure html tags (recommended)": "Perminar somente tags html seguras (recomendado)",
"Allow styles": "Allow styles", "Allow styles": "Permitir Estilos",
"Allow dangerous html tags": "Allow dangerous html tags", "Allow dangerous html tags": "Permitir tags html perigosas",
"Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.", "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Converter setas de texto em simbolos. ⚠ Isto irá interferir no use de comentários em HTML em Markdown.",
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠", "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Você colou um link referente a um anexo que não pôde ser encontrado no local de armazenamento desta nota. A vinculação de anexos de referência de links só é suportada se o local de origem e de destino for o mesmo de armazenamento. Por favor, arraste e solte o anexo na nota! ⚠",
"Disabled": "Disabled" "Disabled": "Disabled"
} }

View File

@@ -144,6 +144,7 @@
"UserName": "Имя пользователя", "UserName": "Имя пользователя",
"Password": "Пароль", "Password": "Пароль",
"Russian": "Русский", "Russian": "Русский",
"Thai": "Thai (ภาษาไทย)",
"Editor Rulers": "Editor Rulers", "Editor Rulers": "Editor Rulers",
"Enable": "Enable", "Enable": "Enable",
"Disable": "Disable", "Disable": "Disable",

View File

@@ -142,6 +142,7 @@
"Spanish": "Spanish", "Spanish": "Spanish",
"Unsaved Changes!": "Unsaved Changes!", "Unsaved Changes!": "Unsaved Changes!",
"Russian": "Russian", "Russian": "Russian",
"Thai": "Thai (ภาษาไทย)",
"Editor Rulers": "Editor Rulers", "Editor Rulers": "Editor Rulers",
"Enable": "Enable", "Enable": "Enable",
"Disable": "Disable", "Disable": "Disable",

182
locales/th.json Normal file
View File

@@ -0,0 +1,182 @@
{
"Notes": "โน๊ต",
"Tags": "แท็ก",
"Preferences": "ตั้งค่า",
"Make a note": "สร้างโน๊ต",
"Ctrl": "Ctrl",
"Ctrl(^)": "Ctrl(^)",
"to create a new note": "เพื่อสร้างโน๊ต",
"Toggle Mode": "Toggle Mode",
"Add tag...": "เพิ่มแท็ก...",
"Trash": "ถังขยะ",
"MODIFICATION DATE": "แก้ไขเมื่อ",
"Words": "คำ",
"Letters": "ตัวอักษร",
"STORAGE": "แหล่งจัดเก็บ",
"FOLDER": "โฟลเดอร์",
"CREATION DATE": "สร้างเมื่อ",
"NOTE LINK": "NOTE LINK",
".md": ".md",
".txt": ".txt",
".html": ".html",
"Print": "พิมพ์",
"Your preferences for Boostnote": "การตั้งค่าของคุณสำหรับ Boostnote",
"Help": "ช่วยเหลือ",
"Hide Help": "ซ่อนการช่วยเหลือ",
"Storages": "แหล่งจัดเก็บ",
"Add Storage Location": "เพิ่มแหล่งจัดเก็บ",
"Add Folder": "เพิ่มโฟลเดอร์",
"Select Folder": "เลือกโฟลเดอร์",
"Open Storage folder": "เปิดโฟลเดอร์แหล่งจัดเก็บ",
"Unlink": "ยกเลิกการลิงค์",
"Edit": "แก้ไข",
"Delete": "ลบ",
"Interface": "หน้าตาโปรแกรม",
"Interface Theme": "ธีมของโปรแกรม",
"Default": "ค่าเริ่มต้น",
"White": "โทนสว่าง",
"Solarized Dark": "Solarized Dark",
"Dark": "โทนมืด",
"Show a confirmation dialog when deleting notes": "แสดงหน้าต่างยืนยันเมื่อทำการลบโน๊ต",
"Disable Direct Write (It will be applied after restarting)": "ปิด Direct Write (It will be applied after restarting)",
"Show only related tags": "แสดงเฉพาะแท็กที่เกี่ยวข้อง",
"Editor Theme": "ธีมของ Editor",
"Editor Font Size": "ขนาดอักษรของ Editor",
"Editor Font Family": "แบบอักษรของ Editor",
"Editor Indent Style": "รูปแบบการย่อหน้าของ Editor",
"Spaces": "ช่องว่าง",
"Tabs": "แท็บ",
"Switch to Preview": "Switch to Preview",
"When Editor Blurred": "When Editor Blurred",
"When Editor Blurred, Edit On Double Click": "When Editor Blurred, Edit On Double Click",
"On Right Click": "On Right Click",
"Editor Keymap": "รูปแบบคีย์ลัดของ Editor",
"default": "ค่าเริ่มต้น",
"vim": "vim",
"emacs": "emacs",
"⚠️ Please restart boostnote after you change the keymap": "⚠️ กรุณาปิดและเปิดโปรแกรมใหม่ หลังจากคุณเปลี่ยนคีย์ลัด",
"Show line numbers in the editor": "แสดงหมายเลขบรรทัด",
"Allow editor to scroll past the last line": "อนุญาตให้เลื่อน Scroll เลยบรรทัดสุดท้ายได้",
"Enable smart quotes": "เปิด Smart quotes",
"Bring in web page title when pasting URL on editor": "แสดงชื่อ Title ของเว็บไซต์เมื่อวางลิงค์ใน Editor",
"Preview": "พรีวิว",
"Preview Font Size": "ขนาดอักษร",
"Preview Font Family": "แบบอักษร",
"Code block Theme": "ธีมของ Code block",
"Allow preview to scroll past the last line": "อนุญาตให้เลื่อน Scroll เลยบรรทัดสุดท้ายได้",
"Show line numbers for preview code blocks": "แสดงหมายเลขบรรทัดใน Code block",
"LaTeX Inline Open Delimiter": "LaTeX Inline Open Delimiter",
"LaTeX Inline Close Delimiter": "LaTeX Inline Close Delimiter",
"LaTeX Block Open Delimiter": "LaTeX Block Open Delimiter",
"LaTeX Block Close Delimiter": "LaTeX Block Close Delimiter",
"PlantUML Server": "เซิฟเวอร์ของ PlantUML",
"Community": "ชุมชนผู้ใช้",
"Subscribe to Newsletter": "สมัครรับข่าวสาร",
"GitHub": "GitHub",
"Blog": "บล็อก",
"Facebook Group": "กลุ่ม Facebook",
"Twitter": "Twitter",
"About": "เกี่ยวกับ",
"Boostnote": "Boostnote",
"An open source note-taking app made for programmers just like you.": "เป็นแอพพลิเคชันจดบันทึก ที่ออกแบบมาเพื่อโปรแกรมเมอร์อย่างคุณ.",
"Website": "เว็บไซต์",
"Development": "การพัฒนา",
" : Development configurations for Boostnote.": " : การตั้งค่าต่างๆสำหรับการพัฒนา Boostnote.",
"Copyright (C) 2017 - 2018 BoostIO": "สงวนลิขสิทธิ์ (C) 2017 - 2018 BoostIO",
"License: GPL v3": "License: GPL v3",
"Analytics": "การวิเคราะห์",
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote จะเก็บข้อมูลแบบไม่ระบุตัวตนเพื่อนำไปใช้ในการปรับปรุงแอพพลิเคชันเท่านั้น, และจะไม่มีการเก็บข้อมูลส่วนตัวใดๆของคุณ เช่น ข้อมูลในโน๊ตของคุณอย่างเด็ดขาด.",
"You can see how it works on ": "คุณสามารถดูรายละเอียดเพิ่มเติมได้ที่ ",
"You can choose to enable or disable this option.": "คุณสามารถเลือกที่จะเปิดหรือปิดตัวเลือกนี้ได้.",
"Enable analytics to help improve Boostnote": "เปิดการวิเคราะห์ สำหรับการนำไปปรับปรุงพัฒนา Boostnote",
"Crowdfunding": "การระดมทุนสาธารณะ",
"Dear everyone,": "สวัสดีทุกคน,",
"Thank you for using Boostnote!": "ขอขอบคุณที่เลือกใช้ Boostnote!",
"Boostnote is used in about 200 different countries and regions by an awesome community of developers.": "มีการใช้งาน Boostnote จากสังคมผู้ใช้ที่เป็น Developer มากกว่า 200 ประเทศทั่วโลกจากหลากหลายภูมิภาค.",
"To continue supporting this growth, and to satisfy community expectations,": "เพื่อให้เกิดการสนับสนุนให้เกิดการเติบโตอย่างต่อเนื่อง, และเพื่อพัฒนาให้ตรงตามความต้องการของชุมชนผู้ใช้,",
"we would like to invest more time and resources in this project.": "เราต้องใช้เวลา และการลงทุนด้านทรัพยากรสำหรับโครงการนี้.",
"If you like this project and see its potential, you can help by supporting us on OpenCollective!": "ถ้าคุณชอบและมองเห็นความเป็นไปได้ในอนาคต, คุณสามารถช่วยเหลือด้วยการสนับสนุนเราผ่าน OpenCollective!",
"Thanks,": "ขอขอบคุณ,",
"Boostnote maintainers": "กลุ่มผู้พัฒนา Boostnote",
"Support via OpenCollective": "สนับสนุนผ่าน OpenCollective",
"Language": "ภาษา",
"English": "English",
"German": "German",
"French": "French",
"Show \"Saved to Clipboard\" notification when copying": "แสดงการแจ้งเตือน \"บันทึกไปยังคลิปบอร์ด\" เมื่อทำการคัดลอก",
"All Notes": "โน๊ตทั้งหมด",
"Starred": "รายการโปรด",
"Are you sure to ": "คุณแน่ใจหรือไม่ที่จะ ",
" delete": " ลบ",
"this folder?": "โฟลเดอร์นี้?",
"Confirm": "ยืนยัน",
"Cancel": "ยกเลิก",
"Markdown Note": "โน๊ต Markdown",
"This format is for creating text documents. Checklists, code blocks and Latex blocks are available.": "รูปแบบนี้ใช้สำหรับสร้างเอกสารทั่วไป. รองรับการเขียนเช็คลิสต์, แทรกโค้ด และการเขียนโดยใช้ Latex.",
"Snippet Note": "โน๊ต Snippet",
"This format is for creating code snippets. Multiple snippets can be grouped into a single note.": "รูปแบบนี้ใช้สำหรับสร้าง Code snippets. สามารถรวมหลาย Snippets เป็นโน๊ตเดียวกันได้.",
"Tab to switch format": "กด Tab เพื่อเปลี่ยนรูปแบบที่เลือก",
"Updated": "เรียงตามอัพเดท",
"Created": "เรียงตามเวลาที่สร้างโน๊ต",
"Alphabetically": "เรียงตามอักษร",
"Counter": "Counter",
"Default View": "มุมมองปกติ",
"Compressed View": "มุมมองหนาแน่น",
"Search": "ค้นหา",
"Blog Type": "ประเภทของบล็อก",
"Blog Address": "ที่อยู่ของบล็อก",
"Save": "บันทึก",
"Auth": "การยืนยันตัวตน",
"Authentication Method": "รูปแบบการยืนยันตัวตน",
"JWT": "JWT",
"USER": "USER",
"Token": "Token",
"Storage": "แหล่งจัดเก็บ",
"Hotkeys": "คีย์ลัด",
"Show/Hide Boostnote": "แสดง/ซ่อน Boostnote",
"Toggle editor mode": "เปิด/ปิด Editor mode",
"Restore": "กู้คืน",
"Permanent Delete": "ลบถาวร",
"Confirm note deletion": "ยืนยันการลบโน๊ต",
"This will permanently remove this note.": "โน๊ตของคุณจะถูกลบอย่างถาวร.",
"Successfully applied!": "สำเร็จ!",
"Albanian": "Albanian",
"Chinese (zh-CN)": "Chinese (zh-CN)",
"Chinese (zh-TW)": "Chinese (zh-TW)",
"Danish": "Danish",
"Japanese": "Japanese",
"Korean": "Korean",
"Norwegian": "Norwegian",
"Polish": "Polish",
"Portuguese": "Portuguese",
"Spanish": "Spanish",
"You have to save!": "คุณจำเป็นต้องบันทึก!",
"UserName": "UserName",
"Password": "Password",
"Russian": "Russian",
"Hungarian": "Hungarian",
"Thai": "Thai (ภาษาไทย)",
"Command(⌘)": "Command(⌘)",
"Add Storage": "เพิ่มแหล่งจัดเก็บ",
"Name": "ชื่อ",
"Type": "ชนิด",
"File System": "ระบบไฟล์",
"Setting up 3rd-party cloud storage integration:": "ดูวิธีการตั้งค่า หากต้องการใช้งานแบบลิงค์ไฟล์ร่วมกับผู้ให้บริการเก็บข้อมูลบนคลาวด์",
"Cloud-Syncing-and-Backup": "Cloud-Syncing-and-Backup",
"Location": "ที่อยู่",
"Add": "เพิ่ม",
"Unlink Storage": "ยกเลิกการลิงค์ Storage",
"Unlinking removes this linked storage from Boostnote. No data is removed, please manually delete the folder from your hard drive if needed.": "การยกเลิกการลิงค์ จะเป็นการลบการลิงค์แหล่งจัดเก็บออกไปจาก Boostnote. แต่ไฟล์ข้อมูลจะไม่ถูกลบ, หากต้องการลบข้อมูล กรุณาลบโพลเดอร์ของข้อมูลในเครื่องของท่านด้วยตัวเอง.",
"Editor Rulers": "ไม้บรรทัด Editor",
"Enable": "เปิด",
"Disable": "ปิด",
"Sanitization": "Sanitization",
"Only allow secure html tags (recommended)": "อนุญาตเฉพาะ HTML tag ที่มีความปลอดภัย (แนะนำ)",
"Render newlines in Markdown paragraphs as <br>": "ใช้ <br> แทนอักขระขึ้นบรรทัดใหม่ในข้อความ Markdown",
"Allow styles": "อนุญาตการใช้ styles",
"Allow dangerous html tags": "อนุญาตให้ใช้ html tags ที่ไม่ปลอดภัย",
"Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "แปลงลูกศรจากรูปแบบข้อความให้เป็นสัญลักษณ์. ⚠ สิ่งนี้จะเป็นการแทรกโดยใช้ HTML comment ลงไปใน Markdown ที่คุณเขียน.",
"⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ ไม่พบไฟล์แนบในโน๊ตนี้ จากลิงค์ที่คุณได้วาง. คุณสามารถวางลิงค์ที่อ้างอิงไปยังไฟล์แนบ เฉพาะกรณีที่ต้นทาง และปลายทางที่อ้างถึงนั้นอยู่ใน 'แหล่งจัดเก็บ เดียวกัน. กรุณาใช้การลากและวางเพื่อใส่ไฟล์แนบแทน! ⚠",
"Enable smart table editor": "เปิดการใช้ Smart table editor",
"Snippet Default Language": "ทำการ Snippet ภาษาที่เป็นค่าเริ่มต้น"
}

View File

@@ -15,7 +15,7 @@
"dev": "node dev-scripts/dev.js" "dev": "node dev-scripts/dev.js"
}, },
"config": { "config": {
"electron-version": "2.0.7" "electron-version": "3.0.3"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -56,7 +56,7 @@
"codemirror": "^5.40.2", "codemirror": "^5.40.2",
"codemirror-mode-elixir": "^1.1.1", "codemirror-mode-elixir": "^1.1.1",
"electron-config": "^1.0.0", "electron-config": "^1.0.0",
"electron-gh-releases": "^2.0.2", "electron-gh-releases": "^2.0.4",
"escape-string-regexp": "^1.0.5", "escape-string-regexp": "^1.0.5",
"file-uri-to-path": "^1.0.0", "file-uri-to-path": "^1.0.0",
"file-url": "^2.0.2", "file-url": "^2.0.2",
@@ -68,10 +68,12 @@
"iconv-lite": "^0.4.19", "iconv-lite": "^0.4.19",
"immutable": "^3.8.1", "immutable": "^3.8.1",
"js-sequence-diagrams": "^1000000.0.6", "js-sequence-diagrams": "^1000000.0.6",
"js-yaml": "^3.12.0",
"katex": "^0.9.0", "katex": "^0.9.0",
"lodash": "^4.11.1", "lodash": "^4.11.1",
"lodash-move": "^1.1.1", "lodash-move": "^1.1.1",
"markdown-it": "^6.0.1", "markdown-it": "^6.0.1",
"markdown-it-abbr": "^1.0.4",
"markdown-it-admonition": "^1.0.4", "markdown-it-admonition": "^1.0.4",
"markdown-it-emoji": "^1.1.1", "markdown-it-emoji": "^1.1.1",
"markdown-it-footnote": "^3.0.0", "markdown-it-footnote": "^3.0.0",
@@ -81,6 +83,8 @@
"markdown-it-named-headers": "^0.0.4", "markdown-it-named-headers": "^0.0.4",
"markdown-it-plantuml": "^1.1.0", "markdown-it-plantuml": "^1.1.0",
"markdown-it-smartarrows": "^1.0.1", "markdown-it-smartarrows": "^1.0.1",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"markdown-toc": "^1.2.0", "markdown-toc": "^1.2.0",
"mdurl": "^1.0.1", "mdurl": "^1.0.1",
"mermaid": "^8.0.0-rc.8", "mermaid": "^8.0.0-rc.8",
@@ -126,7 +130,7 @@
"css-loader": "^0.19.0", "css-loader": "^0.19.0",
"devtron": "^1.1.0", "devtron": "^1.1.0",
"dom-storage": "^2.0.2", "dom-storage": "^2.0.2",
"electron": "2.0.7", "electron": "3.0.3",
"electron-packager": "^12.0.0", "electron-packager": "^12.0.0",
"eslint": "^3.13.1", "eslint": "^3.13.1",
"eslint-config-standard": "^6.2.1", "eslint-config-standard": "^6.2.1",

View File

@@ -50,11 +50,70 @@ const smartQuotes = 'This is a "QUOTE".'
const breaks = 'This is the first line.\nThis is the second line.' const breaks = 'This is the first line.\nThis is the second line.'
const abbrevations = `
## abbr
The HTML specification
is maintained by the W3C.
*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium
`
const subTexts = `
## sub
H~2~0
`
const supTexts = `
## sup
29^th^
`
const deflists = `
## definition list
### list 1
Term 1
~ Definition 1
Term 2
~ Definition 2a
~ Definition 2b
Term 3
~
### list 2
Term 1
: Definition 1
Term 2 with *inline markup*
: Definition 2
{ some code, part of Definition 2 }
Third paragraph of definition 2.
`
const shortcuts = '<kbd>Ctrl</kbd>\n\n[[Ctrl]]'
export default { export default {
basic, basic,
codeblock, codeblock,
katex, katex,
checkboxes, checkboxes,
smartQuotes, smartQuotes,
breaks breaks,
abbrevations,
subTexts,
supTexts,
deflists,
shortcuts
} }

View File

@@ -43,3 +43,28 @@ test('Markdown.render() should render line breaks correctly', t => {
const renderedNonBreaks = newmd.render(markdownFixtures.breaks) const renderedNonBreaks = newmd.render(markdownFixtures.breaks)
t.snapshot(renderedNonBreaks) t.snapshot(renderedNonBreaks)
}) })
test('Markdown.render() should renders abbrevations correctly', t => {
const rendered = md.render(markdownFixtures.abbrevations)
t.snapshot(rendered)
})
test('Markdown.render() should renders sub correctly', t => {
const rendered = md.render(markdownFixtures.subTexts)
t.snapshot(rendered)
})
test('Markdown.render() should renders sup correctly', t => {
const rendered = md.render(markdownFixtures.supTexts)
t.snapshot(rendered)
})
test('Markdown.render() should renders definition lists correctly', t => {
const rendered = md.render(markdownFixtures.deflists)
t.snapshot(rendered)
})
test('Markdown.render() should render shortcuts correctly', t => {
const rendered = md.render(markdownFixtures.shortcuts)
t.snapshot(rendered)
})

View File

@@ -18,6 +18,14 @@ Generated by [AVA](https://ava.li).
This is the second line.</p>␊ This is the second line.</p>␊
` `
## Markdown.render() should render shortcuts correctly
> Snapshot 1
`<p data-line="0"><kbd>Ctrl</kbd></p>␊
<p data-line="2"><kbd>Ctrl</kbd></p>␊
`
## Markdown.render() should renders KaTeX correctly ## Markdown.render() should renders KaTeX correctly
> Snapshot 1 > Snapshot 1
@@ -25,13 +33,22 @@ Generated by [AVA](https://ava.li).
`<span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>c</mi><mo>=</mo><mi>p</mi><mi>m</mi><mi>s</mi><mi>q</mi><mi>r</mi><mi>t</mi><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup></mrow></mrow><annotation encoding="application/x-tex">c = pmsqrt{a^2 + b^2}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8641079999999999em;"></span><span class="strut bottom" style="height:1.0585479999999998em;vertical-align:-0.19444em;"></span><span class="base"><span class="mord mathit">c</span><span class="mord rule" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mord rule" style="margin-right:0.2777777777777778em;"></span><span class="mord mathit">p</span><span class="mord mathit">m</span><span class="mord mathit">s</span><span class="mord mathit" style="margin-right:0.03588em;">q</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">t</span><span class="mord"><span class="mord"><span class="mord mathit">a</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mord rule" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mord rule" style="margin-right:0.2222222222222222em;"></span><span class="mord"><span class="mord mathit">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span></span>␊ `<span class="katex-display"><span class="katex"><span class="katex-mathml"><math><semantics><mrow><mi>c</mi><mo>=</mo><mi>p</mi><mi>m</mi><mi>s</mi><mi>q</mi><mi>r</mi><mi>t</mi><mrow><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><msup><mi>b</mi><mn>2</mn></msup></mrow></mrow><annotation encoding="application/x-tex">c = pmsqrt{a^2 + b^2}</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.8641079999999999em;"></span><span class="strut bottom" style="height:1.0585479999999998em;vertical-align:-0.19444em;"></span><span class="base"><span class="mord mathit">c</span><span class="mord rule" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mord rule" style="margin-right:0.2777777777777778em;"></span><span class="mord mathit">p</span><span class="mord mathit">m</span><span class="mord mathit">s</span><span class="mord mathit" style="margin-right:0.03588em;">q</span><span class="mord mathit" style="margin-right:0.02778em;">r</span><span class="mord mathit">t</span><span class="mord"><span class="mord"><span class="mord mathit">a</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span><span class="mord rule" style="margin-right:0.2222222222222222em;"></span><span class="mbin">+</span><span class="mord rule" style="margin-right:0.2222222222222222em;"></span><span class="mord"><span class="mord mathit">b</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.8641079999999999em;"><span style="top:-3.113em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight">2</span></span></span></span></span></span></span></span></span></span></span></span></span>␊
` `
## Markdown.render() should renders abbrevations correctly
> Snapshot 1
`<h2 data-line="1" id="abbr">abbr</h2>␊
<p data-line="3">The <abbr title="Hyper Text Markup Language">HTML</abbr> specification<br />␊
is maintained by the <abbr title="World Wide Web Consortium">W3C</abbr>.</p>␊
`
## Markdown.render() should renders checkboxes ## Markdown.render() should renders checkboxes
> Snapshot 1 > Snapshot 1
`<ul>␊ `<ul>␊
<li class="taskListItem"><input type="checkbox" id="checkbox-2" /> Unchecked</li>␊ <li class="taskListItem" data-line="1"><input type="checkbox" id="checkbox-2" /> Unchecked</li>␊
<li class="taskListItem checked"><input type="checkbox" checked id="checkbox-3" /> Checked</li>␊ <li class="taskListItem checked" data-line="2"><input type="checkbox" checked id="checkbox-3" /> Checked</li>␊
</ul>␊ </ul>␊
` `
@@ -39,8 +56,42 @@ Generated by [AVA](https://ava.li).
> Snapshot 1 > Snapshot 1
`<pre class="code CodeMirror"><span class="filename">filename.js</span><span class="lineNumber CodeMirror-gutters"><span class="CodeMirror-linenumber">2</span></span><code class="js">var project = 'boostnote'; `<pre class="code CodeMirror" data-line="1">
<span class="filename">filename.js</span>␊
<span class="lineNumber CodeMirror-gutters"><span class="CodeMirror-linenumber">2</span></span>␊
<code class="js">var project = 'boostnote';␊
</code>␊
</pre>`
## Markdown.render() should renders definition lists correctly
> Snapshot 1
`<h2 data-line="1" id="definition-list">definition list</h2>␊
<h3 data-line="3" id="list-1">list 1</h3>␊
<dl>␊
<dt data-line="5">Term 1</dt>␊
<dd data-line="6">Definition 1</dd>␊
<dt data-line="8">Term 2</dt>␊
<dd data-line="9">Definition 2a</dd>␊
<dd data-line="10">Definition 2b</dd>␊
</dl>␊
<p data-line="12">Term 3<br />␊
~</p>␊
<h3 data-line="16" id="list-2">list 2</h3>␊
<dl>␊
<dt data-line="18">Term 1</dt>␊
<dd data-line="20">␊
<p data-line="20">Definition 1</p>␊
</dd>␊
<dt data-line="22">Term 2 with <em>inline markup</em></dt>␊
<dd data-line="24">␊
<p data-line="24">Definition 2</p>␊
<pre><code> { some code, part of Definition 2 }␊
</code></pre>␊ </code></pre>␊
<p data-line="28">Third paragraph of definition 2.</p>␊
</dd>␊
</dl>␊
` `
## Markdown.render() should renders markdown correctly ## Markdown.render() should renders markdown correctly
@@ -52,31 +103,47 @@ Generated by [AVA](https://ava.li).
<iframe width="560" height="315" src="https://www.youtube.com/embed/L0qNPLsvmyM" frameborder="0" allowfullscreen></iframe>␊ <iframe width="560" height="315" src="https://www.youtube.com/embed/L0qNPLsvmyM" frameborder="0" allowfullscreen></iframe>␊
<h2 data-line="6" id="Docs-%F0%9F%93%9D">Docs 📝</h2>␊ <h2 data-line="6" id="Docs-%F0%9F%93%9D">Docs 📝</h2>␊
<ul>␊ <ul>␊
<li><a href="https://hackernoon.com/boostnote-boost-your-happiness-productivity-and-creativity-315034efeebe">Boostnote | Boost your happiness, productivity and creativity.</a></li>␊ <li data-line="7"><a href="https://hackernoon.com/boostnote-boost-your-happiness-productivity-and-creativity-315034efeebe">Boostnote | Boost your happiness, productivity and creativity.</a></li>␊
<li><a href="https://github.com/BoostIO/Boostnote/wiki/Cloud-Syncing-and-Backup">Cloud Syncing &amp; Backups</a></li>␊ <li data-line="8"><a href="https://github.com/BoostIO/Boostnote/wiki/Cloud-Syncing-and-Backup">Cloud Syncing &amp; Backups</a></li>␊
<li><a href="https://github.com/BoostIO/Boostnote/wiki/Sync-Data-Across-Desktop-and-Mobile-apps">How to sync your data across Desktop and Mobile apps</a></li>␊ <li data-line="9"><a href="https://github.com/BoostIO/Boostnote/wiki/Sync-Data-Across-Desktop-and-Mobile-apps">How to sync your data across Desktop and Mobile apps</a></li>␊
<li><a href="https://github.com/BoostIO/Boostnote/wiki/Evernote">Convert data from <strong>Evernote</strong> to Boostnote.</a></li>␊ <li data-line="10"><a href="https://github.com/BoostIO/Boostnote/wiki/Evernote">Convert data from <strong>Evernote</strong> to Boostnote.</a></li>␊
<li><a href="https://github.com/BoostIO/Boostnote/wiki/Keyboard-Shortcuts">Keyboard Shortcuts</a></li>␊ <li data-line="11"><a href="https://github.com/BoostIO/Boostnote/wiki/Keyboard-Shortcuts">Keyboard Shortcuts</a></li>␊
<li><a href="https://github.com/BoostIO/Boostnote/wiki/Keymaps-in-Editor-mode">Keymaps in Editor mode</a></li>␊ <li data-line="12"><a href="https://github.com/BoostIO/Boostnote/wiki/Keymaps-in-Editor-mode">Keymaps in Editor mode</a></li>␊
<li><a href="https://github.com/BoostIO/Boostnote/wiki/Syntax-Highlighting">How to set syntax highlight in Snippet note</a></li>␊ <li data-line="13"><a href="https://github.com/BoostIO/Boostnote/wiki/Syntax-Highlighting">How to set syntax highlight in Snippet note</a></li>␊
</ul>␊ </ul>␊
<hr />␊ <hr />␊
<h2 data-line="17" id="Article-Archive-%F0%9F%93%9A">Article Archive 📚</h2>␊ <h2 data-line="17" id="Article-Archive-%F0%9F%93%9A">Article Archive 📚</h2>␊
<ul>␊ <ul>␊
<li><a href="http://bit.ly/2mOJPu7">Reddit English</a></li>␊ <li data-line="18"><a href="http://bit.ly/2mOJPu7">Reddit English</a></li>␊
<li><a href="https://www.reddit.com/r/boostnote_es/">Reddit Spanish</a></li>␊ <li data-line="19"><a href="https://www.reddit.com/r/boostnote_es/">Reddit Spanish</a></li>␊
<li><a href="https://www.reddit.com/r/boostnote_cn/">Reddit Chinese</a></li>␊ <li data-line="20"><a href="https://www.reddit.com/r/boostnote_cn/">Reddit Chinese</a></li>␊
<li><a href="https://www.reddit.com/r/boostnote_jp/">Reddit Japanese</a></li>␊ <li data-line="21"><a href="https://www.reddit.com/r/boostnote_jp/">Reddit Japanese</a></li>␊
</ul>␊ </ul>␊
<hr />␊ <hr />␊
<h2 data-line="25" id="Community-%F0%9F%8D%BB">Community 🍻</h2>␊ <h2 data-line="25" id="Community-%F0%9F%8D%BB">Community 🍻</h2>␊
<ul>␊ <ul>␊
<li><a href="http://bit.ly/2AWWzkD">GitHub</a></li>␊ <li data-line="26"><a href="http://bit.ly/2AWWzkD">GitHub</a></li>␊
<li><a href="http://bit.ly/2z8BUJZ">Twitter</a></li>␊ <li data-line="27"><a href="http://bit.ly/2z8BUJZ">Twitter</a></li>␊
<li><a href="http://bit.ly/2jcca8t">Facebook Group</a></li>␊ <li data-line="28"><a href="http://bit.ly/2jcca8t">Facebook Group</a></li>␊
</ul>␊ </ul>␊
` `
## Markdown.render() should renders sub correctly
> Snapshot 1
`<h2 data-line="1" id="sub">sub</h2>␊
<p data-line="3">H<sub>2</sub>0</p>␊
`
## Markdown.render() should renders sup correctly
> Snapshot 1
`<h2 data-line="1" id="sup">sup</h2>␊
<p data-line="3">29<sup>th</sup></p>␊
`
## Markdown.render() should text with quotes correctly ## Markdown.render() should text with quotes correctly
> Snapshot 1 > Snapshot 1

View File

@@ -2826,20 +2826,6 @@ electron-config@^1.0.0:
dependencies: dependencies:
conf "^1.0.0" conf "^1.0.0"
electron-download@^3.0.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-3.3.0.tgz#2cfd54d6966c019c4d49ad65fbe65cc9cdef68c8"
dependencies:
debug "^2.2.0"
fs-extra "^0.30.0"
home-path "^1.0.1"
minimist "^1.2.0"
nugget "^2.0.0"
path-exists "^2.1.0"
rc "^1.1.2"
semver "^5.3.0"
sumchecker "^1.2.0"
electron-download@^4.0.0: electron-download@^4.0.0:
version "4.1.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.0.tgz#bf932c746f2f87ffcc09d1dd472f2ff6b9187845" resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.0.tgz#bf932c746f2f87ffcc09d1dd472f2ff6b9187845"
@@ -2854,7 +2840,21 @@ electron-download@^4.0.0:
semver "^5.3.0" semver "^5.3.0"
sumchecker "^2.0.1" sumchecker "^2.0.1"
electron-gh-releases@^2.0.2: electron-download@^4.1.0:
version "4.1.1"
resolved "https://registry.yarnpkg.com/electron-download/-/electron-download-4.1.1.tgz#02e69556705cc456e520f9e035556ed5a015ebe8"
dependencies:
debug "^3.0.0"
env-paths "^1.0.0"
fs-extra "^4.0.1"
minimist "^1.2.0"
nugget "^2.0.1"
path-exists "^3.0.0"
rc "^1.2.1"
semver "^5.4.1"
sumchecker "^2.0.2"
electron-gh-releases@^2.0.4:
version "2.0.4" version "2.0.4"
resolved "https://registry.yarnpkg.com/electron-gh-releases/-/electron-gh-releases-2.0.4.tgz#198c07a0970fb8e80fcc67bd0b4198a010923dc3" resolved "https://registry.yarnpkg.com/electron-gh-releases/-/electron-gh-releases-2.0.4.tgz#198c07a0970fb8e80fcc67bd0b4198a010923dc3"
dependencies: dependencies:
@@ -2938,12 +2938,12 @@ electron-winstaller@^2.2.0:
lodash.template "^4.2.2" lodash.template "^4.2.2"
temp "^0.8.3" temp "^0.8.3"
electron@2.0.7: electron@3.0.3:
version "2.0.7" version "3.0.3"
resolved "https://registry.yarnpkg.com/electron/-/electron-2.0.7.tgz#f7ce410433298e319032ce31f0e6ffd709ff052c" resolved "https://registry.yarnpkg.com/electron/-/electron-3.0.3.tgz#2857ed8d37c1b46e0a75a72684800252255f3243"
dependencies: dependencies:
"@types/node" "^8.0.24" "@types/node" "^8.0.24"
electron-download "^3.0.1" electron-download "^4.1.0"
extract-zip "^1.0.3" extract-zip "^1.0.3"
emojis-list@^2.0.0: emojis-list@^2.0.0:
@@ -3058,10 +3058,6 @@ es6-promise@^3.1.2:
version "3.3.1" version "3.3.1"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"
es6-promise@^4.0.5:
version "4.2.4"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.4.tgz#dc4221c2b16518760bd8c39a52d8f356fc00ed29"
es6-set@~0.1.5: es6-set@~0.1.5:
version "0.1.5" version "0.1.5"
resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1"
@@ -3782,16 +3778,6 @@ fs-extra@0.26.7, fs-extra@^0.26.0, fs-extra@^0.26.7:
path-is-absolute "^1.0.0" path-is-absolute "^1.0.0"
rimraf "^2.2.8" rimraf "^2.2.8"
fs-extra@^0.30.0:
version "0.30.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^2.1.0"
klaw "^1.0.0"
path-is-absolute "^1.0.0"
rimraf "^2.2.8"
fs-extra@^1.0.0: fs-extra@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950"
@@ -3807,7 +3793,7 @@ fs-extra@^2.0.0:
graceful-fs "^4.1.2" graceful-fs "^4.1.2"
jsonfile "^2.1.0" jsonfile "^2.1.0"
fs-extra@^4.0.0: fs-extra@^4.0.0, fs-extra@^4.0.1:
version "4.0.3" version "4.0.3"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.3.tgz#0d852122e5bc5beb453fb028e9c0c9bf36340c94"
dependencies: dependencies:
@@ -4350,10 +4336,6 @@ home-or-tmp@^2.0.0:
os-homedir "^1.0.0" os-homedir "^1.0.0"
os-tmpdir "^1.0.1" os-tmpdir "^1.0.1"
home-path@^1.0.1:
version "1.0.6"
resolved "https://registry.yarnpkg.com/home-path/-/home-path-1.0.6.tgz#d549dc2465388a7f8667242c5b31588d29af29fc"
hooker@~0.2.3: hooker@~0.2.3:
version "0.2.3" version "0.2.3"
resolved "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959" resolved "https://registry.yarnpkg.com/hooker/-/hooker-0.2.3.tgz#b834f723cc4a242aa65963459df6d984c5d3d959"
@@ -5344,7 +5326,7 @@ js-yaml@^3.10.0, js-yaml@^3.5.1, js-yaml@^3.7.0:
argparse "^1.0.7" argparse "^1.0.7"
esprima "^4.0.0" esprima "^4.0.0"
js-yaml@^3.8.1: js-yaml@^3.12.0, js-yaml@^3.8.1:
version "3.12.0" version "3.12.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
dependencies: dependencies:
@@ -5866,6 +5848,10 @@ map-visit@^1.0.0:
dependencies: dependencies:
object-visit "^1.0.0" object-visit "^1.0.0"
markdown-it-abbr@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/markdown-it-abbr/-/markdown-it-abbr-1.0.4.tgz#d66b5364521cbb3dd8aa59dadfba2fb6865c8fd8"
markdown-it-admonition@^1.0.4: markdown-it-admonition@^1.0.4:
version "1.0.4" version "1.0.4"
resolved "https://registry.yarnpkg.com/markdown-it-admonition/-/markdown-it-admonition-1.0.4.tgz#d7bbc7eb1fe6168fc8cc304de7a9d8c993acb2f5" resolved "https://registry.yarnpkg.com/markdown-it-admonition/-/markdown-it-admonition-1.0.4.tgz#d7bbc7eb1fe6168fc8cc304de7a9d8c993acb2f5"
@@ -5906,6 +5892,14 @@ markdown-it-smartarrows@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/markdown-it-smartarrows/-/markdown-it-smartarrows-1.0.1.tgz#b570e9c0ff9812e0db6ace19afa5ba12b64bb9a7" resolved "https://registry.yarnpkg.com/markdown-it-smartarrows/-/markdown-it-smartarrows-1.0.1.tgz#b570e9c0ff9812e0db6ace19afa5ba12b64bb9a7"
markdown-it-sub@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/markdown-it-sub/-/markdown-it-sub-1.0.0.tgz#375fd6026eae7ddcb012497f6411195ea1e3afe8"
markdown-it-sup@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/markdown-it-sup/-/markdown-it-sup-1.0.0.tgz#cb9c9ff91a5255ac08f3fd3d63286e15df0a1fc3"
markdown-it@^5.0.3: markdown-it@^5.0.3:
version "5.1.0" version "5.1.0"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-5.1.0.tgz#25286b8465bac496f3f1b77eed544643e9bd718d" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-5.1.0.tgz#25286b8465bac496f3f1b77eed544643e9bd718d"
@@ -6480,7 +6474,7 @@ npmlog@^4.0.2:
gauge "~2.7.3" gauge "~2.7.3"
set-blocking "~2.0.0" set-blocking "~2.0.0"
nugget@^2.0.0: nugget@^2.0.0, nugget@^2.0.1:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/nugget/-/nugget-2.0.1.tgz#201095a487e1ad36081b3432fa3cada4f8d071b0" resolved "https://registry.yarnpkg.com/nugget/-/nugget-2.0.1.tgz#201095a487e1ad36081b3432fa3cada4f8d071b0"
dependencies: dependencies:
@@ -6782,7 +6776,7 @@ path-browserify@0.0.0:
version "0.0.0" version "0.0.0"
resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a" resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-0.0.0.tgz#a0b870729aae214005b7d5032ec2cbbb0fb4451a"
path-exists@^2.0.0, path-exists@^2.1.0: path-exists@^2.0.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b"
dependencies: dependencies:
@@ -7353,7 +7347,7 @@ raw-body@2.3.2:
iconv-lite "0.4.19" iconv-lite "0.4.19"
unpipe "1.0.0" unpipe "1.0.0"
rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.1.7: rc@^1.0.1, rc@^1.1.2, rc@^1.1.6, rc@^1.1.7, rc@^1.2.1:
version "1.2.8" version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
dependencies: dependencies:
@@ -7367,8 +7361,8 @@ rcedit@^1.0.0:
resolved "https://registry.yarnpkg.com/rcedit/-/rcedit-1.1.0.tgz#ae21c28d4efdd78e95fcab7309a5dd084920b16a" resolved "https://registry.yarnpkg.com/rcedit/-/rcedit-1.1.0.tgz#ae21c28d4efdd78e95fcab7309a5dd084920b16a"
react-autosuggest@^9.4.0: react-autosuggest@^9.4.0:
version "9.4.0" version "9.4.2"
resolved "https://registry.yarnpkg.com/react-autosuggest/-/react-autosuggest-9.4.0.tgz#3146bc9afa4f171bed067c542421edec5ca94294" resolved "https://registry.yarnpkg.com/react-autosuggest/-/react-autosuggest-9.4.2.tgz#18cc0bebeebda3d24328e3da301f061a444ae223"
dependencies: dependencies:
prop-types "^15.5.10" prop-types "^15.5.10"
react-autowhatever "^10.1.2" react-autowhatever "^10.1.2"
@@ -8584,14 +8578,7 @@ stylus@^0.52.4:
sax "0.5.x" sax "0.5.x"
source-map "0.1.x" source-map "0.1.x"
sumchecker@^1.2.0: sumchecker@^2.0.1, sumchecker@^2.0.2:
version "1.3.1"
resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-1.3.1.tgz#79bb3b4456dd04f18ebdbc0d703a1d1daec5105d"
dependencies:
debug "^2.2.0"
es6-promise "^4.0.5"
sumchecker@^2.0.1:
version "2.0.2" version "2.0.2"
resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e" resolved "https://registry.yarnpkg.com/sumchecker/-/sumchecker-2.0.2.tgz#0f42c10e5d05da5d42eea3e56c3399a37d6c5b3e"
dependencies: dependencies: