JSFiddle - React, Tailwind, and code Playground

by epinapala

HTML

<textarea id="dd">;lklklkl:ejdhsjk</textarea>

<button onclick="test()">Click me</button>

JavaScript

window.test = function(){
var html = $('#dd').text();
html = html.replace
    (/(\A|\n);([^:]+):(.+)/g,
        function (match, match2, match3, match4)
        {
            console.log(match);
            alert("<dl><dt>" + match3 + "</dt>"+
            match(match4) + "</dl>");
        });
    
    //alert(html);
}

window.match = function(match4){
    var x = "";
match4.replace(/(\:|\r?\n|\r|^)(([^\:\r\n]*))/g, function(s,m,k){
       x += "<dd>" + s + "</dd>";
});
    
    return x;
};