editor fits parent

master
Bel LaPointe 2022-02-15 12:53:00 -07:00
parent c2f5edead6
commit 54a4a70eac
2 changed files with 41 additions and 2 deletions

View File

@ -63,6 +63,25 @@ func main() {
log.Println("hi") log.Println("hi")
} }
` + "```" + ` ` + "```" + `
and
now
the
newlines
`, `,
}, },
"Tree": `{ "Tree": `{

View File

@ -2,6 +2,26 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.css">
<script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/easymde/dist/easymde.min.js"></script>
<style> <style>
#easyMDEwrap,
#easyMDEwrap > .EasyMDEContainer,
#easyMDEwrap > .EasyMDEContainer > .CodeMirror {
flex-grow: 1;
display: flex;
flex-direction: column;
}
.EasyMDEContainer > .CodeMirror {
height: 5px;
}
#article {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding: 5px;
display: flex;
flex-direction: column;
}
#titlepath, #title { #titlepath, #title {
font-size: 2rem; font-size: 2rem;
font-weight: 600; font-weight: 600;
@ -72,7 +92,7 @@
</span> </span>
</div> </div>
<!-- todo: each line no is an anchor --> <!-- todo: each line no is an anchor -->
<div class="monospace"> <div id="easyMDEwrap" class="monospace">
<textarea id="my-text-area"></textarea> <textarea id="my-text-area"></textarea>
</div> </div>
<div id="saveFeedback" style="min-height: 1.2em; text-align: right;"> <div id="saveFeedback" style="min-height: 1.2em; text-align: right;">
@ -88,7 +108,7 @@
element: document.getElementById('my-text-area'), element: document.getElementById('my-text-area'),
forceSync: true, forceSync: true,
indentWithTabs: false, indentWithTabs: false,
initialValue: "# initial\nvalue", initialValue: "loading...",
showIcons: ["code", "table"], showIcons: ["code", "table"],
spellChecker: false, spellChecker: false,
sideBySideFullscreen: false, sideBySideFullscreen: false,