minor fixes
This commit is contained in:
@@ -50,3 +50,6 @@ Some example CSS to style the HTML output can be found in `styles/makoto.css`.
|
||||
- `missing-image-alt`
|
||||
- `empty-link`
|
||||
- `weird-href`
|
||||
|
||||
## Tests
|
||||
Makoto's test cases are in `index.ts`. The tests are decently thorough for everything except tables, so hopefully most edge cases were caught.
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
min-height: 100vh;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#grid-container {
|
||||
display: grid;
|
||||
grid-template-columns: 50vw 50vw;
|
||||
grid-template-columns: 50% 50%;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.section {
|
||||
|
||||
15
web.ts
15
web.ts
@@ -35,7 +35,7 @@ function render_warnings(warnings: Warning[]) {
|
||||
|
||||
const refresh_html = () => {
|
||||
//go through the lines and get the editor text
|
||||
let editor_text: string = Array.from(editor.children).map((item) => item.textContent).reduce((added, current) => added+"\n"+current);
|
||||
let editor_text: string = Array.from(editor.children).map((item) => item.textContent).reduce((added, current) => added+"\n"+current)!;
|
||||
if (use_local_storage) {
|
||||
localStorage.setItem("markdown", editor_text);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ editor.addEventListener("keyup", () => {
|
||||
let range: Range = document.createRange();
|
||||
range.setStart(li, 0);
|
||||
range.collapse(true);
|
||||
let selection: Selection = window.getSelection();
|
||||
let selection: Selection = window.getSelection()!;
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
}
|
||||
@@ -139,10 +139,10 @@ if (params.get("save") === "true") {
|
||||
if (localStorage) {
|
||||
use_local_storage = true;
|
||||
}
|
||||
let stored_markdown: string = localStorage.getItem("markdown");
|
||||
let stored_markdown = localStorage.getItem("markdown");
|
||||
if (stored_markdown) {
|
||||
let extra_lines: string[] = stored_markdown.split("\n");
|
||||
(editor.children[0] as HTMLElement).innerText = extra_lines.shift();
|
||||
(editor.children[0] as HTMLElement).innerText = extra_lines.shift()!;
|
||||
for (let i=0; i < extra_lines.length; i++) {
|
||||
let additional_line: HTMLElement = document.createElement("LI");
|
||||
//needs to be .innerHTML so the html space entity can be parsed
|
||||
@@ -153,12 +153,13 @@ if (params.get("save") === "true") {
|
||||
}
|
||||
}
|
||||
|
||||
if (params.get("ignore")) {
|
||||
let ignore_param = params.get("ignore");
|
||||
if (ignore_param) {
|
||||
//allow user to specify warnings to ignore
|
||||
if (params.get("ignore") === "all") {
|
||||
if (ignore_param === "all") {
|
||||
ignore_all_warnings = true;
|
||||
} else {
|
||||
ignore_warnings = params.get("ignore").split(",");
|
||||
ignore_warnings = ignore_param.split(",");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user