leeoniya / reMarked.js

client-side HTML > markdown
http://leeoniya.github.io/reMarked.js/
396 stars 97 forks source link

allow user input in demo page #23

Closed sunaku closed 11 years ago

sunaku commented 11 years ago

Hello,

Please enhance the demo page to allow the user to:

  1. Enter their input HTML in a textarea
  2. Press the "reMark it!" button
  3. See the resulting Markdown output

This would allow people to use reMarked.js without having to install it!

Thanks for your consideration.

leeoniya commented 11 years ago

yeah, it's been on my todo list for a while. also maybe a config sidebar for toggling different options. i'll try to get it done in the next few days...

leeoniya commented 11 years ago

done, try it out.

sunaku commented 11 years ago

Thanks, it works but there is a styling problem: if the browser window is not wide enough, then the textarea obscures the "reMark it" button. That is, I'm able to input my custom HTML but I cannot click on the button (it's behind the textarea) to convert it into markdown. :sweat_smile:

sunaku commented 11 years ago

Here is a simple (but not pretty) fix:

diff --git a/css/demo.css b/css/demo.css
index 991dc1d..e01834a 100644
--- a/css/demo.css
+++ b/css/demo.css
@@ -3,7 +3,7 @@
 }

 .markdown-body,
-#remarked {
+#remarked, #html-inp {
        margin-left: 230px;
 }

@@ -59,11 +59,5 @@
 #html-inp {
        width: 960px;
        height: 500px;
-       position: fixed;
-       top: 50%;
-       left: 50%;
-       margin-top: -250px;
-       margin-left: -480px;
-       padding: 5px;
        display: none;
leeoniya commented 11 years ago

all fixed up

sunaku commented 11 years ago

Awesome! Thanks :smiley_cat: