Compare commits

...

2 Commits

Author SHA1 Message Date
c30156dd10 Problem: copy and paste always creates new nodes
All checks were successful
continuous-integration/drone/push Build is passing
Solution: allow one line text as normals text
2022-01-09 23:46:54 +01:00
e743576043 Problem: block markdown is not supported
Solution: render cells as block markdown
2022-01-09 23:46:24 +01:00
3 changed files with 77 additions and 28 deletions

View File

@ -393,9 +393,7 @@ function Editor(holder, input) {
// converted = converted.replace('#[[DONE]]', '<input class="checkbox" type="checkbox" checked />') // converted = converted.replace('#[[DONE]]', '<input class="checkbox" type="checkbox" checked />')
// todo = false; // todo = false;
// } // }
MD.options.html = true converted = MD.render(converted)
converted = MD.renderInline(converted)
MD.options.html = false
} }
try { try {

View File

@ -13,7 +13,7 @@
@import url('https://rsms.me/inter/inter.css'); @import url('https://rsms.me/inter/inter.css');
html { html {
font-family: 'Inter', sans-serif; font-family: 'Inter', sans-serif;
} }
body { body {
@ -29,6 +29,7 @@ body {
content: "[["; content: "[[";
color: #ccc; color: #ccc;
} }
.content a.wiki-link::after { .content a.wiki-link::after {
content: "]]"; content: "]]";
color: #ccc; color: #ccc;
@ -85,6 +86,7 @@ body {
.list-item:hover .fold { .list-item:hover .fold {
visibility: visible; visibility: visible;
} }
.list-item.selected .fold { .list-item.selected .fold {
visibility: visible; visibility: visible;
} }
@ -217,11 +219,12 @@ mark {
width: 100%; width: 100%;
.wiki-link { .wiki-link {
&::before, &::after { &::before, &::after {
content: ''; content: '';
} }
} }
} }
.sidebar-right { .sidebar-right {
width: 100%; width: 100%;
padding: 0 12px; padding: 0 12px;
@ -242,6 +245,7 @@ mark {
height: 32px; height: 32px;
text-align: center; text-align: center;
} }
.calendar-update:active { .calendar-update:active {
border: 3px solid #aaa; border: 3px solid #aaa;
border-radius: 4px; border-radius: 4px;
@ -276,12 +280,15 @@ mark {
margin-top: 6px; margin-top: 6px;
} }
} }
.week { .week {
background: #ebebff; background: #ebebff;
} }
.week a { .week a {
color: black; color: black;
} }
.day a { .day a {
position: absolute; position: absolute;
top: 0; top: 0;
@ -290,11 +297,13 @@ mark {
left: 0; left: 0;
color: black; color: black;
} }
.day .day-text { .day .day-text {
font-size: 9pt; font-size: 9pt;
display: block; display: block;
margin-top: 3px; margin-top: 3px;
} }
.day .day-count { .day .day-count {
position: absolute; position: absolute;
width: 100%; width: 100%;
@ -306,11 +315,14 @@ mark {
right: 0; right: 0;
bottom: 0; bottom: 0;
} }
.today { .today {
font-weight: bold; font-weight: bold;
} }
.current { .current {
background: #f0f0f0; background: #f0f0f0;
&.has-content::after { &.has-content::after {
font-weight: bold; font-weight: bold;
content: '\00B7'; content: '\00B7';
@ -331,11 +343,13 @@ mark {
.wiki-list-editor { .wiki-list-editor {
max-width: 960px; max-width: 960px;
} }
.wiki-list-editor { .wiki-list-editor {
.table-wrapper { .table-wrapper {
max-width: 960px; max-width: 960px;
overflow-x: auto; overflow-x: auto;
} }
.table-wrapper td { .table-wrapper td {
white-space: pre; white-space: pre;
text-wrap: none; text-wrap: none;
@ -350,6 +364,7 @@ mark {
flex-grow: 1; flex-grow: 1;
min-height: 24px; min-height: 24px;
} }
#autocomplete { #autocomplete {
z-index: 1; z-index: 1;
width: 640px; width: 640px;
@ -360,25 +375,31 @@ mark {
background: white; background: white;
border: 1px solid #ccc; border: 1px solid #ccc;
} }
#autocomplete li > a { #autocomplete li > a {
display: block; display: block;
} }
#autocomplete li div { #autocomplete li div {
font-size: 0.8em; font-size: 0.8em;
display: block; display: block;
color: black; color: black;
} }
#autocomplete li { #autocomplete li {
padding: 4px 16px; padding: 4px 16px;
max-height: 5em; max-height: 5em;
overflow: hidden; overflow: hidden;
} }
#autocomplete li:hover { #autocomplete li:hover {
background: #fefefe; background: #fefefe;
} }
#autocomplete li.selected { #autocomplete li.selected {
background: lightblue; background: lightblue;
} }
#link-complete { #link-complete {
z-index: 1; z-index: 1;
width: 280px; width: 280px;
@ -395,6 +416,7 @@ mark {
padding: 4px 16px; padding: 4px 16px;
white-space: nowrap; white-space: nowrap;
} }
#link-complete li.selected { #link-complete li.selected {
background: lightblue; background: lightblue;
} }
@ -431,6 +453,7 @@ ins {
.checklist--item-text { .checklist--item-text {
align-self: center; align-self: center;
} }
html { html {
font-family: 'Inter', sans-serif; font-family: 'Inter', sans-serif;
} }
@ -458,14 +481,26 @@ input.input-line {
align-items: center; align-items: center;
} }
textarea { textarea {
border: none; border: none;
resize: none; resize: none;
} }
.list-item .content { .list-item .content {
white-space: pre-wrap; //white-space: pre-wrap;
}
.wiki-list-editor .content {
blockquote {
padding-top: 0;
padding-bottom: 0;
}
h1, h2, h3, h4, h5, h6 {
margin-bottom: 0;
}
ul, ol {
margin-top: 0;
}
} }
.hide { .hide {
@ -475,15 +510,19 @@ textarea {
.selected { .selected {
background: lightblue; background: lightblue;
} }
.fold.closed + .marker { .fold.closed + .marker {
border-color: lightblue; border-color: lightblue;
} }
.selected .marker { .selected .marker {
border-color: lightblue; border-color: lightblue;
} }
#editor { #editor {
width: 750px; width: 750px;
} }
.editor.selected .marker { .editor.selected .marker {
/*border-color: white;*/ /*border-color: white;*/
} }
@ -540,11 +579,13 @@ input.input-line, input.input-line:active {
.breadcrumb li { .breadcrumb li {
max-width: 200px; max-width: 200px;
} }
.breadcrumb li > a { .breadcrumb li > a {
text-overflow: ellipsis; text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
display: block; display: block;
} }
.searchbar { .searchbar {
position: relative; position: relative;
display: flex; display: flex;
@ -558,12 +599,14 @@ input.input-line, input.input-line:active {
width: 400px; width: 400px;
} }
} }
.wiki-table .expression { .wiki-table .expression {
display: none; display: none;
} }
.todo--todo { .todo--todo {
} }
.todo--done { .todo--done {
text-decoration: line-through; text-decoration: line-through;
text-decoration-skip: leading-spaces; text-decoration-skip: leading-spaces;
@ -572,45 +615,49 @@ input.input-line, input.input-line:active {
.tabs { .tabs {
width: 100%; width: 100%;
} }
.tab-bar { .tab-bar {
display: flex; display: flex;
border-bottom: 1px solid black; border-bottom: 1px solid black;
} }
.tab-bar .tab { .tab-bar .tab {
padding: 8px 16px; padding: 8px 16px;
cursor: pointer; cursor: pointer;
border-bottom: 3px solid white; border-bottom: 3px solid white;
} }
.tab-bar .tab:first-child { .tab-bar .tab:first-child {
margin-left: 24px; margin-left: 24px;
} }
.tab-bar .tab.tab-active { .tab-bar .tab.tab-active {
border-bottom: 3px solid black; border-bottom: 3px solid black;
} }
.tab-bar .tab + .tab { .tab-bar .tab + .tab {
margin-left: 24px; margin-left: 24px;
} }
.tab-page { .tab-page {
display: none; display: none;
} }
.tab.tab-active { .tab.tab-active {
} }
.tab-page.tab-active { .tab-page.tab-active {
display: block; display: block;
} }
.search.input { .search.input {
border: none; border: none;
padding: 2px; padding: 2px;
} }
.search.input.is-error { .search.input.is-error {
outline: red solid 4px; outline: red solid 4px;
} }

View File

@ -526,14 +526,18 @@ function editor(root, inputData, options) {
let items = pastedData.toString().split(/\n+/); let items = pastedData.toString().split(/\n+/);
let item = $(this).parents('.list-item') let item = $(this).parents('.list-item')
let id = item.attr('data-id') let id = item.attr('data-id')
const firstItem = store.value(id) if (items.length === 1) {
items = _.map(items, text => { return true
const item = newListItem(firstItem.indented) } else {
item.text = text const firstItem = store.value(id)
return item items = _.map(items, text => {
}) const item = newListItem(firstItem.indented)
store.insertAfter(id, ...items) item.text = text
trigger('change') return item
})
store.insertAfter(id, ...items)
trigger('change')
}
return false return false
} }
}); });