+
+
+
diff --git a/examples/html/style.css b/examples/html/style.css
new file mode 100644
index 0000000..9191ef8
--- /dev/null
+++ b/examples/html/style.css
@@ -0,0 +1,3 @@
+body {
+ font-family: 'Courier New', Courier, monospace;
+}
\ No newline at end of file
diff --git a/examples/html/test.md b/examples/html/test.md
new file mode 100644
index 0000000..d2b7d77
--- /dev/null
+++ b/examples/html/test.md
@@ -0,0 +1,36 @@
+Marked - Markdown Parser
+========================
+
+[Marked] lets you convert [Markdown] into HTML. Markdown is a simple text format whose goal is to be very easy to read and write, even when not converted to HTML. This demo page will let you type anything you like and see how it gets converted. Live. No more waiting around.
+
+How To Use The Demo
+-------------------
+
+1. Type in stuff on the left.
+2. See the live updates on the right.
+
+That's it. Pretty simple. There's also a drop-down option in the upper right to switch between various views:
+
+- **Preview:** A live display of the generated HTML as it would render in a browser.
+- **HTML Source:** The generated HTML before your browser makes it pretty.
+- **Lexer Data:** What [marked] uses internally, in case you like gory stuff like this.
+- **Quick Reference:** A brief run-down of how to format things using markdown.
+
+Why Markdown?
+-------------
+
+It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [markdown] says,
+
+> The overriding design goal for Markdown's
+> formatting syntax is to make it as readable
+> as possible. The idea is that a
+> Markdown-formatted document should be
+> publishable as-is, as plain text, without
+> looking like it's been marked up with tags
+> or formatting instructions.
+
+Ready to start writing? Either start changing stuff on the left or
+[clear everything](/demo/?text=) with a simple click.
+
+[Marked]: https://github.com/markedjs/marked/
+[Markdown]: http://daringfireball.net/projects/markdown/
diff --git a/examples/server.js b/examples/server.js
new file mode 100644
index 0000000..e59c4b3
--- /dev/null
+++ b/examples/server.js
@@ -0,0 +1,16 @@
+const getPort = require('get-port');
+const openUrl = require('openurl');
+
+const Server = require('../lib/server/Server');
+
+const run = async () => {
+ const root = "/Users/lnunnink/Projects/merge/test";
+ const port = await getPort();
+
+ const server = new Server(port, root);
+ server.start();
+
+ openUrl.open(`http://localhost:${port}`);
+};
+
+run();
diff --git a/lib/Merge.js b/lib/Merge.js
index 21c3b67..3a85ffe 100644
--- a/lib/Merge.js
+++ b/lib/Merge.js
@@ -67,6 +67,10 @@ class Merge {
* path.
*/
async loadState(urlOrObject) {
+ if (this.state) {
+ // State has already been loaded
+ return;
+ }
if (typeof urlOrObject === 'object') {
this.state = urlOrObject;
if (this.document) this.parse();