![image](https://cdn.steemitimages.com/DQmNTmAzVe52SPyofE26tQkQy7gYupQysEoUoyPKEmgCpw3/code-1839406_1280.jpg) Meet Markup builder, a minimal powerful utility for building markup, be it HTML or Markdown. This library can help you transform your markup by sanitizing against XSS, converting markdown to HTML and more. It is built on [XSS](https://www.npmjs.com/package/xss), [Remarkable](https://www.npmjs.com/package/remarkable), [DOMParser](https://www.npmjs.com/package/dom-parser) and [Markup tools](https://www.npmjs.com/package/markup-tools). ### How do you use Markup builder? **Node.js** ``` npm install markup-builder --save ``` Use as: ``` const markup = require('markup-builder'); ``` **Browser** `https://unpkg.com/markup-builder/dist/markup.min.js` Exported to the browser window as `markup`. ### Using markup builder ``` const t = "**Lorem ipsum dolor sit amet**, consectetuer adipiscing elit. Aenean <i>commodo ligula eget</i> dolor. Aenean massa. Cum @sociis natoque #penatibus et magnis dis parturient montes,<script>alert('Quisque rutrum.')</script> nascetur ridiculus mus. Donec quam felis, https://www.youtube.com/watch?v=sO_YEdTcVXc https://travis-ci.org/peerquery/markup-builder"; //inside async function var content = await markup.build.content(t /*,config, options*/ ); //with about options object console.log(content); //With promise API markup.build.content(t /*,config, options*/).then(function(content){ //options is optional, using defaults console.log(content); }); // "<p><strong>Lorem ipsum dolor sit amet</strong>, consectetuer adipiscing elit. Aenean <i>commodo ligula eget</i> dolor. Aenean massa. Cum <a target="_blank" href="/user/sociis">@sociis</a> natoque <a target="_blank" href="/trending/penatibus "> #penatibus </a> et magnis dis parturient montes,<script>alert(\'Quisque rutrum.\')</script> nascetur ridiculus mus. Donec quam felis, <a href="https://www.youtube.com/watch?v=sO_YEdTcVXc">https://www.youtube.com/watch?v=sO_YEdTcVXc</a> <a href="https://travis-ci.org/peerquery/markup-builder">https://travis-ci.org/peerquery/markup-builder</p></a>\n" ``` ### How is Markup builder different from Markup tools? [Markup tools](https://www.npmjs.com/package/markup-tools) is a small set of standalone utilities for basic text manipulation. However Markup builder allows you to actually build markup. [Markup builder](https://www.npmjs.com/package/markup-builder)'s build functions use Markup tools to build all un-attached hashtags into hyperlinked tags, all un-attached mentions into hyperlinked mentions, as well as build all raw urls and image links into their respective tags. In addition to this markup is also sanitized, and markdown is converted to HTML. ### Resources and links Github repo: [https://github.com/peerquery/markup-builder](https://github.com/peerquery/markup-builder) NPM page: [https://www.npmjs.com/package/markup-builder](https://www.npmjs.com/package/markup-builder) - - - Published on [Peer Query - Blockchain-powered p2p collaboration](http://www.peerquery.com/report/dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt).
post_id | 64,298,960 |
---|---|
author | dzivenu |
permlink | dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt |
category | utopian-io |
json_metadata | {"image":["https:\/\/cdn.steemitimages.com\/DQmNTmAzVe52SPyofE26tQkQy7gYupQysEoUoyPKEmgCpw3\/code-1839406_1280.jpg"],"links":["https:\/\/www.npmjs.com\/package\/xss","https:\/\/www.npmjs.com\/package\/remarkable","https:\/\/www.npmjs.com\/package\/dom-parser","https:\/\/www.npmjs.com\/package\/markup-tools","https:\/\/www.npmjs.com\/package\/markup-builder","https:\/\/github.com\/peerquery\/markup-builder","http:\/\/www.peerquery.com\/report\/dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt"],"format":"markdown","app":"steemit\/0.1","tags":["utopian-io","blog","news","dev"]} |
created | 2018-10-15 15:29:12 |
last_update | 2018-10-15 15:34:24 |
depth | 0 |
children | 5 |
net_rshares | 10,725,553,378,337 |
last_payout | 2018-10-22 15:29:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 10.341 SBD |
curator_payout_value | 3.177 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 3,240 |
author_reputation | 35,120,084,774,494 |
root_title | "Introducing Markup builder: minimalist but powerful HTML and Markdown markup builder" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
eforucom | 0 | 4,122,418,023 | 2% | ||
techslut | 0 | 74,700,344,465 | 20% | ||
wanwenguo | 0 | 699,623,037 | 100% | ||
sacred-agent | 0 | 3,037,773,771 | 3% | ||
pluse | 0 | 594,831,270 | 100% | ||
steem-d-anlovnit | 0 | 16,353,270,884 | 35% | ||
espoem | 0 | 12,065,348,041 | 10% | ||
utopian-io | 0 | 9,805,775,195,737 | 6.9% | ||
emrebeyler | 0 | 18,632,727,011 | 1.25% | ||
gattino | 0 | 543,810,083 | 5% | ||
amosbastian | 0 | 68,197,549,233 | 35.99% | ||
grzesiekb | 0 | 139,744,246,789 | 100% | ||
boggan | 0 | 131,556,895 | 46% | ||
didic | 0 | 12,486,383,311 | 20% | ||
fanariba | 0 | 448,099,813 | 100% | ||
ethanlee | 0 | 3,290,753,113 | 100% | ||
coinsandchains | 0 | 3,727,192,678 | 8% | ||
acbka | 0 | 522,604,031 | 100% | ||
merry1990 | 0 | 522,662,638 | 100% | ||
sergcat | 0 | 522,385,509 | 100% | ||
loft505 | 0 | 524,207,549 | 100% | ||
dimka10 | 0 | 525,008,632 | 100% | ||
olegjadkov | 0 | 519,521,473 | 100% | ||
baancap | 0 | 202,465,012 | 50% | ||
baandak | 0 | 214,978,963 | 50% | ||
baanggal | 0 | 233,296,220 | 50% | ||
vladser58 | 0 | 519,609,447 | 100% | ||
vayuzhipsch | 0 | 518,923,183 | 100% | ||
cryptouru | 0 | 20,327,992,136 | 100% | ||
danilkramov | 0 | 521,820,647 | 100% | ||
gartiv88 | 0 | 524,124,581 | 100% | ||
kaczmareke | 0 | 522,784,723 | 100% | ||
evasivepike | 0 | 522,505,498 | 100% | ||
berwynelbow | 0 | 523,179,356 | 100% | ||
movementfrugal | 0 | 521,477,032 | 100% | ||
backpackflu | 0 | 523,898,954 | 100% | ||
monkbulimia | 0 | 523,374,798 | 100% | ||
whimperrubbery | 0 | 523,418,381 | 100% | ||
lenalidchyk63 | 0 | 522,652,394 | 100% | ||
petrov21 | 0 | 518,794,599 | 100% | ||
semenova32 | 0 | 522,670,484 | 100% | ||
romansilenkov | 0 | 519,480,440 | 100% | ||
truthly | 0 | 165,936,109 | 100% | ||
olgafalatova | 0 | 519,522,556 | 100% | ||
rebrovivan | 0 | 519,770,492 | 100% | ||
scholarjeans | 0 | 519,735,704 | 100% | ||
telephonewhy | 0 | 519,589,957 | 100% | ||
whipinterrupt | 0 | 519,576,723 | 100% | ||
clotsthou | 0 | 519,582,558 | 100% | ||
towheelocate | 0 | 519,404,699 | 100% | ||
mothersmerlin | 0 | 519,552,260 | 100% | ||
milkyteammate | 0 | 519,722,820 | 100% | ||
pointsbee | 0 | 521,934,030 | 100% | ||
muffintwinning | 0 | 519,665,701 | 100% | ||
crystaleur | 0 | 519,776,501 | 100% | ||
sleddergirl | 0 | 522,438,575 | 100% | ||
mercedesmetric | 0 | 522,175,512 | 100% | ||
muddygrey | 0 | 519,658,943 | 100% | ||
stimulusmaybe | 0 | 519,450,040 | 100% | ||
sheepishdiagram | 0 | 519,639,310 | 100% | ||
malmseycafe | 0 | 522,460,793 | 100% | ||
grouseunhelpful | 0 | 520,021,722 | 100% | ||
puffinbusy | 0 | 522,247,971 | 100% | ||
kiryuha11 | 0 | 519,549,822 | 100% | ||
ozueva8 | 0 | 519,774,730 | 100% | ||
ykapitonov | 0 | 519,204,275 | 100% | ||
meme.nation | 0 | 6,065,811,049 | 100% | ||
mops2e | 0 | 283,545,299 | 10% | ||
spotted | 0 | 44,668,911,690 | 50% | ||
test-test | 0 | 522,308,430 | 100% | ||
minnowsmith | 0 | 478,711,519 | 25% | ||
eggyrothwell | 0 | 520,276,153 | 100% | ||
nobeliumforce | 0 | 525,247,437 | 100% | ||
smartcurator | 0 | 588,765,970 | 47.5% | ||
steem-ua | 0 | 395,685,125,688 | 3.04% | ||
niksem1983 | 0 | 524,013,475 | 100% | ||
dzhozefrays | 0 | 526,796,055 | 100% | ||
bridzhesc | 0 | 525,534,200 | 100% | ||
nikbelin1983 | 0 | 523,906,290 | 100% | ||
ekarina10 | 0 | 526,200,533 | 100% | ||
anmarch1986 | 0 | 525,414,071 | 100% | ||
stas.borenko | 0 | 524,146,606 | 100% | ||
nfc | 0 | 8,967,212,740 | 1% | ||
curbot | 0 | 3,842,953,102 | 10% | ||
bastardwhoop | 0 | 523,523,985 | 100% | ||
lettersacrobatic | 0 | 523,377,179 | 100% | ||
tonkaerobics | 0 | 523,402,173 | 100% | ||
fistjog | 0 | 523,456,420 | 100% | ||
shaftsboal | 0 | 523,339,623 | 100% | ||
dramaticsphene | 0 | 523,437,725 | 100% | ||
cheakeatable | 0 | 523,392,844 | 100% | ||
jaguarqrcode | 0 | 523,202,579 | 100% | ||
fellowracket | 0 | 523,400,455 | 100% | ||
pseudosled | 0 | 523,257,705 | 100% | ||
hoaryhigger | 0 | 523,334,463 | 100% | ||
branchanus | 0 | 523,307,329 | 100% | ||
acrylichoot | 0 | 523,450,341 | 100% | ||
towslug | 0 | 523,411,638 | 100% | ||
facedfagglers | 0 | 523,518,931 | 100% | ||
martelomorals | 0 | 523,446,265 | 100% | ||
triflesleepy | 0 | 523,437,396 | 100% | ||
prickholing | 0 | 523,432,065 | 100% | ||
helpsmendip | 0 | 523,503,923 | 100% | ||
ergotverdant | 0 | 523,522,874 | 100% | ||
glowreining | 0 | 523,296,698 | 100% | ||
wherebyfalabella | 0 | 523,419,553 | 100% | ||
noxioussmoke | 0 | 523,452,025 | 100% | ||
helpscode | 0 | 523,375,625 | 100% | ||
serkra | 0 | 522,996,510 | 100% | ||
anatharl1982 | 0 | 523,401,624 | 100% | ||
anatoliyleshenko | 0 | 523,355,630 | 100% | ||
pavel.klyuev | 0 | 523,447,372 | 100% | ||
zharov.maksim | 0 | 523,417,781 | 100% | ||
mrpetyx | 0 | 523,432,776 | 100% | ||
lena118 | 0 | 523,417,862 | 100% | ||
alsenrivonlo | 0 | 523,374,652 | 100% | ||
paylovarhouve | 0 | 523,396,393 | 100% | ||
pectoralwake | 0 | 523,442,937 | 100% | ||
cogmacdui | 0 | 523,464,784 | 100% | ||
crumphume | 0 | 523,512,644 | 100% | ||
blowfisheclogite | 0 | 523,297,752 | 100% | ||
weaponturkey | 0 | 523,448,307 | 100% | ||
espumaringer | 0 | 523,459,104 | 100% | ||
reiterateabseil | 0 | 523,451,015 | 100% | ||
ownaperture | 0 | 523,373,255 | 100% | ||
headerrelate | 0 | 523,420,017 | 100% | ||
normachazard | 0 | 523,371,065 | 100% | ||
deadeastern | 0 | 523,418,937 | 100% | ||
dominancefels | 0 | 523,459,760 | 100% | ||
joinersathing | 0 | 523,382,043 | 100% | ||
appliedhandbag | 0 | 523,434,853 | 100% | ||
hiveclamorous | 0 | 523,411,220 | 100% | ||
drabitlamb | 0 | 523,301,747 | 100% | ||
beatlewordy | 0 | 523,396,740 | 100% | ||
patefund | 0 | 523,373,681 | 100% | ||
gieldcrocodile | 0 | 523,386,937 | 100% | ||
starotter | 0 | 523,413,847 | 100% | ||
dayerlogistic | 0 | 523,293,745 | 100% | ||
leveretwit | 0 | 523,520,679 | 100% | ||
caelumgoppers | 0 | 523,382,860 | 100% | ||
snugglyugly | 0 | 523,384,815 | 100% | ||
hodgkinamusing | 0 | 523,395,814 | 100% | ||
glyderaubeaf | 0 | 523,356,668 | 100% | ||
earedfinalist | 0 | 523,488,025 | 100% | ||
blonohdikov | 0 | 523,360,196 | 100% | ||
bitok.xyz | 0 | 18,378,232,442 | 2% | ||
bozabalvb | 0 | 498,263,884 | 100% | ||
nelar | 0 | 299,305,206 | 100% |
This is very similar to your previous post: It's the sort of post I'd like to see go into much more detail. I would have liked to know why you decided to make this, why you made the decisions you made while making this. Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category. To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/1/23414313). ---- Need help? Write a ticket on https://support.utopian.io/. Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
post_id | 64,320,446 |
---|---|
author | didic |
permlink | re-dzivenu-dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt-20181015t233029432z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"links":["https:\/\/join.utopian.io\/guidelines","https:\/\/review.utopian.io\/result\/1\/23414313","https:\/\/support.utopian.io\/","https:\/\/discord.gg\/uTyJkNm","https:\/\/join.utopian.io\/"],"app":"steemit\/0.1"} |
created | 2018-10-15 23:30:30 |
last_update | 2018-10-15 23:30:30 |
depth | 1 |
children | 2 |
net_rshares | 4,619,792,926,330 |
last_payout | 2018-10-22 23:30:30 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 4.409 SBD |
curator_payout_value | 1.410 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 712 |
author_reputation | 76,442,227,425,259 |
root_title | "Introducing Markup builder: minimalist but powerful HTML and Markdown markup builder" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
yuxi | 0 | 8,809,979,837 | 30% | ||
pixelfan | 0 | 1,101,356,785 | 0.54% | ||
utopian-io | 0 | 4,517,029,836,441 | 3.21% | ||
emrebeyler | 0 | 14,892,829,656 | 1% | ||
dzivenu | 0 | 19,420,011,646 | 100% | ||
zapncrap | 0 | 1,954,302,930 | 5% | ||
amosbastian | 0 | 9,482,583,394 | 5.19% | ||
curx | 0 | 1,844,865,640 | 5% | ||
organicgardener | 0 | 2,395,625,154 | 25% | ||
hakancelik | 0 | 13,088,179,428 | 20% | ||
mightypanda | 0 | 28,303,517,748 | 25% | ||
fastandcurious | 0 | 1,469,837,671 | 35% |
before i begin let me thank you and utopian for your support, i appreciate it alot sorry for the brief submission, i am a little late on schedule and rushed things. basically, there are two different libraries, markup-tools for basic manipulations while markup-builder does absolute markup processing these two libraries are great for handling Steem based markup as they process markup which is sometimes a mix of HTML and Markdown, they also sanitize markup against XSS, while building raw youtube urls into iframes, raw image links into img tags, raw mentions and hashtags into hyperlinked entities and more they basically handle all the complete parsing, transformations, building and sanitizations of markup so you can just plug it into your project and play. they are also fully customizable giving the developer complete control of the resulting markup they work in both browser and node.js, making them very compact. i am using them on peer query and they will be integrated into curator and adom and other projects. i believe the community could benefit from them the difference between the two is: markup-tools is standalone and dependency free, does powerful text parsing, and building of HTML markup. however markup-builder offers a complete solution including markdown conversion, sanitizing and more. actually, markup-builder uses markup-tool as a dependency
post_id | 64,324,122 |
---|---|
author | dzivenu |
permlink | re-didic-re-dzivenu-dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt-20181016t010900799z |
category | utopian-io |
json_metadata | {"app":"steemit\/0.1","tags":["utopian-io"]} |
created | 2018-10-16 01:09:57 |
last_update | 2018-10-16 01:11:45 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-10-23 01:09:57 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 1,377 |
author_reputation | 35,120,084,774,494 |
root_title | "Introducing Markup builder: minimalist but powerful HTML and Markdown markup builder" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
Thank you for your review, @didic! So far this week you've reviewed 14 contributions. Keep up the good work!
post_id | 64,624,577 |
---|---|
author | utopian-io |
permlink | re-re-dzivenu-dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt-20181015t233029432z-20181020t233021z |
category | utopian-io |
json_metadata | {"app":"beem\/0.20.1"} |
created | 2018-10-20 23:30:24 |
last_update | 2018-10-20 23:30:24 |
depth | 2 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-10-27 23:30:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 109 |
author_reputation | 152,913,012,544,965 |
root_title | "Introducing Markup builder: minimalist but powerful HTML and Markdown markup builder" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
#### Hi @dzivenu! Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your post is eligible for our upvote, thanks to our collaboration with @utopian-io! **Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
post_id | 64,320,980 |
---|---|
author | steem-ua |
permlink | re-dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt-20181015t234454z |
category | utopian-io |
json_metadata | {"app":"beem\/0.20.7"} |
created | 2018-10-15 23:44:54 |
last_update | 2018-10-15 23:44:54 |
depth | 1 |
children | 0 |
net_rshares | 19,031,017,038 |
last_payout | 2018-10-22 23:44:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.016 SBD |
curator_payout_value | 0.005 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 286 |
author_reputation | 23,203,609,903,979 |
root_title | "Introducing Markup builder: minimalist but powerful HTML and Markdown markup builder" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
dzivenu | 0 | 19,031,017,038 | 100% |
Hey, @dzivenu! **Thanks for contributing on Utopian**. Weβre already looking forward to your next contribution! **Get higher incentives and support Utopian.io!** Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)). **Want to chat? Join us on Discord https://discord.gg/h52nFrV.** <a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
post_id | 64,686,072 |
---|---|
author | utopian-io |
permlink | re-dzivenu-introducing-markup-builder-minimalist-but-powerful-html-and-markdown-markup-builder-jnagdv4aux0yt-20181022t023012z |
category | utopian-io |
json_metadata | {"app":"beem\/0.20.1"} |
created | 2018-10-22 02:30:12 |
last_update | 2018-10-22 02:30:12 |
depth | 1 |
children | 0 |
net_rshares | 0 |
last_payout | 2018-10-29 02:30:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 SBD |
curator_payout_value | 0.000 SBD |
pending_payout_value | 0.000 SBD |
promoted | 0.000 SBD |
body_length | 589 |
author_reputation | 152,913,012,544,965 |
root_title | "Introducing Markup builder: minimalist but powerful HTML and Markdown markup builder" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 SBD |
percent_steem_dollars | 10,000 |