-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarkdown.js
More file actions
36 lines (27 loc) · 1.19 KB
/
markdown.js
File metadata and controls
36 lines (27 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// markdown.js
let TITLE = '57.2°F and Mostly Cloudy';
let THEME = 'United';
let XMP = {
text :
`#  **Thibodaux, LA -- Fri, 29 Oct**
### _There Are Mostly Cloudy Skies in Thibodaux Tonight With a Visibility of **9.9 Miles**_.
***
>* #### There is a northwesterly wind blowing at 6 miles per hour.
* #### The temperature is 57°F.
* #### The high today was 66°F.
***
* #### Tomorrow's high will be 70°F and the low will be 48°F with mostly clear skies and a northwesterly wind at about 10 miles per hour.
* #### The chance for precipitation on Saturday is 10%.
***`}
const Q = new URL (window.location.href);
if (Q.searchParams.get('title') != null) {
TITLE = decodeURIComponent(Q.searchParams.get('title'));
THEME = decodeURIComponent(Q.searchParams.get('theme'));
XMP = JSON.parse(decodeURIComponent(Q.searchParams.get('xmp')));
}
console.log(TITLE)
console.log(THEME)
console.log(XMP.text)
document.querySelector("title").innerHTML = TITLE;
document.querySelector("textarea").setAttribute('theme', THEME)
document.querySelector("textarea").innerHTML = `${XMP.text}`;