+ // copy first paragraph to story
+ let wptext = json.parse.text['*'];
+ let storyinput = document.getElementById('story');
+ if (storyinput && wptext) {
+ storyinput.innerHTML = wptext
+ .replace(/<h2.*/s, '') // prefix
+ .replace(/<table.*?<\/table>/sg, '') // ignore infobox
+ .match(/<p>(.*?)<\/p>/s)[0] // first paragraph
+ .replace(/<[^>]*>/g, '') // strip html tags
+ }
+