diff --git a/src/joplin-cfg.json b/src/joplin-cfg.json new file mode 100644 index 0000000..1834f85 --- /dev/null +++ b/src/joplin-cfg.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://joplinapp.org/schema/settings.json", + "locale": "en_GB", + "sync.target": 6, + "markdown.plugin.softbreaks": false, + "markdown.plugin.typographer": false, + "spellChecker.language": "en-US", + "ui.layout": { + "key": "root", + "children": [ + { + "key": "sideBar", + "width": 250, + "visible": true + }, + { + "key": "noteList", + "width": 250, + "visible": true + }, + { + "key": "editor", + "visible": true, + "width": 1493 + }, + { + "key": "plugin-view-joplin.plugin.note.tabs-note.tabs.panel", + "context": { + "pluginId": "joplin.plugin.note.tabs" + }, + "visible": true + } + ], + "visible": true + }, + "noteVisiblePanes": [ + "editor", + "viewer" + ], + "theme": 4, + "sync.6.username": "webdav", + "net.ignoreTlsErrors": true, + "style.editor.contentMaxWidth": 600, + "editor.codeView": true, + "markdown.plugin.sub": true, + "markdown.plugin.sup": true, + "markdown.plugin.multitable": true +} + diff --git a/src/lib.rs b/src/lib.rs index 3d350d1..c888fc7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -100,7 +100,12 @@ mod tests { } fn whitespace() -> impl JsonParser<'static, ()> { - repeated(literal_char(' ')).to(()) + repeated(choice(( + literal_char('\t'), + literal_char('\n'), + literal_char(' '), + ))) + .to(()) } fn json_array() -> impl JsonParser<'static, JsonValue> { @@ -200,7 +205,7 @@ mod tests { } #[test] - fn parse_json() { + fn parse_json_object() { assert_eq!( json_object().parse(r#"{ "a": 23}"#).unwrap().0, JsonValue::Object(vec![("a".into(), JsonValue::Num(23.))]) @@ -210,4 +215,11 @@ mod tests { JsonValue::Object(vec![]) ); } + + #[test] + fn parse_json() { + let test_json = include_str!("joplin-cfg.json"); + let parsed_json = json_object().parse(test_json); + assert!(parsed_json.is_ok()); + } }