From: Dan Brown Date: Thu, 17 Oct 2019 13:32:39 +0000 (+0100) Subject: Merge branch 'fix-1575' of git://github.com/james-geiger/BookStack into james-geiger... X-Git-Tag: v0.28.0~1^2~70 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/e91ef54cc9f8ce6b264bced8191275b6a33e594f?ds=inline;hp=-c Merge branch 'fix-1575' of git://github.com/james-geiger/BookStack into james-geiger-fix-1575 --- e91ef54cc9f8ce6b264bced8191275b6a33e594f diff --combined resources/js/services/code.js index ca66bdb5a,4ab25aeb7..61aac7dc5 --- a/resources/js/services/code.js +++ b/resources/js/services/code.js @@@ -102,6 -102,7 +102,7 @@@ function highlightElem(elem) value: content, mode: mode, lineNumbers: true, + lineWrapping: true, theme: getTheme(), readOnly: true }); @@@ -188,6 -189,7 +189,7 @@@ function wysiwygView(elem) value: content, mode: getMode(lang), lineNumbers: true, + lineWrapping: true, theme: getTheme(), readOnly: true }); @@@ -213,8 -215,8 +215,8 @@@ function popupEditor(elem, modeSuggesti value: content, mode: getMode(modeSuggestion), lineNumbers: true, - theme: getTheme(), - lineWrapping: true + lineWrapping: true, + theme: getTheme() }); } @@@ -240,27 -242,24 +242,27 @@@ function setContent(cmInstance, codeCon } /** - * Get a CodeMirror instace to use for the markdown editor. + * Get a CodeMirror instance to use for the markdown editor. * @param {HTMLElement} elem * @returns {*} */ function markdownEditor(elem) { - let content = elem.textContent; - - return CodeMirror(function (elt) { - elem.parentNode.insertBefore(elt, elem); - elem.style.display = 'none'; - }, { + const content = elem.textContent; + const config = { value: content, mode: "markdown", lineNumbers: true, - theme: getTheme(), lineWrapping: true, + theme: getTheme(), scrollPastEnd: true, - }); + }; + + window.$events.emitPublic(elem, 'editor-markdown-cm::pre-init', {config}); + + return CodeMirror(function (elt) { + elem.parentNode.insertBefore(elt, elem); + elem.style.display = 'none'; + }, config); } /** diff --combined resources/sass/_text.scss index 315f08c34,5959ddab1..cf78c162b --- a/resources/sass/_text.scss +++ b/resources/sass/_text.scss @@@ -90,14 -90,14 +90,14 @@@ h2.list-heading * Link styling */ a { - color: $primary; + color: var(--color-primary); + fill: var(--color-primary); cursor: pointer; text-decoration: none; - transition: color ease-in-out 80ms; + transition: filter ease-in-out 80ms; line-height: 1.6; &:hover { text-decoration: underline; - color: darken($primary, 20%); } &.icon { display: inline-block; @@@ -106,10 -106,6 +106,10 @@@ position: relative; display: inline-block; } + &:focus img:only-child { + outline: 2px dashed var(--color-primary); + outline-offset: 2px; + } } .blended-links a { @@@ -199,7 -195,7 +199,7 @@@ pre blockquote { display: block; position: relative; - border-left: 4px solid $primary; + border-left: 4px solid var(--color-primary); background-color: #F8F8F8; padding: $-s $-m $-s $-xl; &:before { @@@ -224,7 -220,7 +224,7 @@@ code @extend .code-base; display: inline; padding: 1px 3px; - white-space:pre; + white-space:pre-wrap; line-height: 1.2em; margin-bottom: 1.2em; } @@@ -243,6 -239,7 +243,6 @@@ pre code } span.highlight { - //background-color: rgba($primary, 0.2); font-weight: bold; padding: 2px 4px; } @@@ -369,4 -366,3 +369,3 @@@ span.sep margin-right: $-xs; pointer-events: none; } -