Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any JavaScript function in some library for turning simple wiki mark up (given as multi line string) into html?

What I generally need is simple - opensource library with function that will turn given wiki mark up string into html. If you can write such function - please post it here.

It shall be tolerant to html objects inserts like YouTube videos, mathml and TeX inside that string (much alike math.stackexchange)

So is there any such function in some JavaScript library?

Here is a little sample example to try on.

Header 1
========

Header 2
--------

# Header 1 #

## Header 2 ##

###### Header 6

=Header1?=

 = Header1? =

<iframe src="http://player.vimeo.com/video/20344220" width="400" height="225" frameborder="0"></iframe><p><a href="http://vimeo.com/20344220">Drawing Inspiration</a> from <a href="http://vimeo.com/user153493">Wesley Louis</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<iframe title="YouTube video player" width="640" height="390" src="http://www.youtube.com/embed/wV1FrqwZyKw" frameborder="0" allowfullscreen></iframe>

*   Abacus
    * answer
*   Bubbles
    1.  bunk
    2.  bupkis
        * BELITTLER
    3. burper
*   Cunning
like image 622
Rella Avatar asked Mar 01 '11 12:03

Rella


People also ask

What is JavaScript in HTML?

JavaScript is the Programming Language for the Web. JavaScript can update and change both HTML and CSS. JavaScript can calculate, manipulate and validate data.

How do you create a function in JavaScript?

A JavaScript function is defined with the function keyword, followed by a name, followed by parentheses (). Function names can contain letters, digits, underscores, and dollar signs (same rules as variables). The parentheses may include parameter names separated by commas: (parameter1, parameter2, ...)

What is a function in HTML?

A function contains some code that will be executed by an event or a call to that function. A function is a set of statements. You can reuse functions within the same script, or in other documents. You define functions at the beginning of a file (in the head section), and call them later in the document.


2 Answers

Would Markdown be OK?

See the Markdown dingus.

like image 61
rsp Avatar answered Sep 16 '22 14:09

rsp


Try this, http://goessner.net/articles/wiky/ it can also do the reverse operation.

like image 20
erickb Avatar answered Sep 17 '22 14:09

erickb