From 5e9eb7a94ebb7edf2a4b1387a642caa700f9beb0 Mon Sep 17 00:00:00 2001 From: Aimee Gamble-Milner <12508200+aimee-gm@users.noreply.github.com> Date: Sat, 16 May 2020 11:30:37 +0100 Subject: [PATCH] docs(demo): add experimental lang options --- demo/demo.css | 11 ++++++++++- demo/demo.js | 7 ++++--- demo/index.html | 25 +++++++++++++++---------- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/demo/demo.css b/demo/demo.css index c09bd129..77cd9d33 100644 --- a/demo/demo.css +++ b/demo/demo.css @@ -117,7 +117,7 @@ form label { padding: 1rem 0; } -form input, +form input[type="text"], form textarea { width: 100%; display: block; @@ -144,3 +144,12 @@ form textarea { .hide { display: none; } + +.experimental label { + display: inline-block; +} + +h3 { + font-size: 1rem; + margin: 0; +} diff --git a/demo/demo.js b/demo/demo.js index 55c1e86a..3e942e88 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -13,11 +13,11 @@ const setError = (error) => { el.classList.remove("hide"); }; -const parse = (html, { baseUrl }) => { +const parse = (html, options) => { document.getElementById("error").classList.add("hide"); try { - const result = mf2(html, { baseUrl }); + const result = mf2(html, options); setResult(result); } catch (err) { setError(err.message); @@ -29,6 +29,7 @@ const parse = (html, { baseUrl }) => { window.parseHtml = () => { const html = document.getElementById("html").value; const baseUrl = document.getElementById("base-url").value; + const lang = document.getElementById("lang").checked; - return parse(html, { baseUrl }); + return parse(html, { baseUrl, experimental: { lang } }); }; diff --git a/demo/index.html b/demo/index.html index 33e653da..a0283f28 100644 --- a/demo/index.html +++ b/demo/index.html @@ -38,6 +38,13 @@