How to use Markdown method in Mocha

Best JavaScript code snippet using mocha

index.js

Source:index.js Github

copy

Full Screen

1// https://github.com/sindresorhus/github-markdown-css2const styles = `3.markdown-body {4 -ms-text-size-adjust: 100%;5 -webkit-text-size-adjust: 100%;6 margin: 0;7 color: #24292f;8 background-color: #ffffff;9 font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";10 font-size: 16px;11 line-height: 1.5;12 word-wrap: break-word;13}14.markdown-body .octicon {15 display: inline-block;16 fill: currentColor;17 vertical-align: text-bottom;18}19.markdown-body h1:hover .anchor .octicon-link:before,20.markdown-body h2:hover .anchor .octicon-link:before,21.markdown-body h3:hover .anchor .octicon-link:before,22.markdown-body h4:hover .anchor .octicon-link:before,23.markdown-body h5:hover .anchor .octicon-link:before,24.markdown-body h6:hover .anchor .octicon-link:before {25 width: 16px;26 height: 16px;27 content: ' ';28 display: inline-block;29 background-color: currentColor;30 -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");31 mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");32}33.markdown-body details,34.markdown-body figcaption,35.markdown-body figure {36 display: block;37}38.markdown-body summary {39 display: list-item;40}41.markdown-body a {42 background-color: transparent;43 color: #0969da;44 text-decoration: none;45}46.markdown-body a:active,47.markdown-body a:hover {48 outline-width: 0;49}50.markdown-body abbr[title] {51 border-bottom: none;52 -webkit-text-decoration: underline dotted;53 text-decoration: underline dotted;54}55.markdown-body b,56.markdown-body strong {57 font-weight: 600;58}59.markdown-body dfn {60 font-style: italic;61}62.markdown-body h1 {63 margin: .67em 0;64 font-weight: 600;65 padding-bottom: .3em;66 font-size: 2em;67 border-bottom: 1px solid hsla(210,18%,87%,1);68}69.markdown-body mark {70 background-color: #ff0;71 color: #24292f;72}73.markdown-body small {74 font-size: 90%;75}76.markdown-body sub,77.markdown-body sup {78 font-size: 75%;79 line-height: 0;80 position: relative;81 vertical-align: baseline;82}83.markdown-body sub {84 bottom: -0.25em;85}86.markdown-body sup {87 top: -0.5em;88}89.markdown-body img {90 border-style: none;91 max-width: 100%;92 box-sizing: content-box;93 background-color: #ffffff;94}95.markdown-body code,96.markdown-body kbd,97.markdown-body pre,98.markdown-body samp {99 font-family: monospace,monospace;100 font-size: 1em;101}102.markdown-body figure {103 margin: 1em 40px;104}105.markdown-body hr {106 box-sizing: content-box;107 overflow: hidden;108 background: transparent;109 border-bottom: 1px solid hsla(210,18%,87%,1);110 height: .25em;111 padding: 0;112 margin: 24px 0;113 background-color: #d0d7de;114 border: 0;115}116.markdown-body html [type=button],117.markdown-body [type=reset],118.markdown-body [type=submit] {119 -webkit-appearance: button;120}121.markdown-body [type=button]::-moz-focus-inner,122.markdown-body [type=reset]::-moz-focus-inner,123.markdown-body [type=submit]::-moz-focus-inner {124 border-style: none;125 padding: 0;126}127.markdown-body [type=button]:-moz-focusring,128.markdown-body [type=reset]:-moz-focusring,129.markdown-body [type=submit]:-moz-focusring {130 outline: 1px dotted ButtonText;131}132.markdown-body [type=checkbox],133.markdown-body [type=radio] {134 box-sizing: border-box;135 padding: 0;136}137.markdown-body [type=number]::-webkit-inner-spin-button,138.markdown-body [type=number]::-webkit-outer-spin-button {139 height: auto;140}141.markdown-body [type=search] {142 -webkit-appearance: textfield;143 outline-offset: -2px;144}145.markdown-body [type=search]::-webkit-search-cancel-button,146.markdown-body [type=search]::-webkit-search-decoration {147 -webkit-appearance: none;148}149.markdown-body ::-webkit-input-placeholder {150 color: inherit;151 opacity: .54;152}153.markdown-body ::-webkit-file-upload-button {154 -webkit-appearance: button;155 font: inherit;156}157.markdown-body a:hover {158 text-decoration: underline;159}160.markdown-body hr::before {161 display: table;162 content: "";163}164.markdown-body hr::after {165 display: table;166 clear: both;167 content: "";168}169.markdown-body table {170 border-spacing: 0;171 border-collapse: collapse;172 display: block;173 width: max-content;174 max-width: 100%;175 overflow: auto;176}177.markdown-body td,178.markdown-body th {179 padding: 0;180}181.markdown-body details summary {182 cursor: pointer;183}184.markdown-body details:not([open])>*:not(summary) {185 display: none !important;186}187.markdown-body kbd {188 display: inline-block;189 padding: 3px 5px;190 font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;191 line-height: 10px;192 color: #24292f;193 vertical-align: middle;194 background-color: #f6f8fa;195 border: solid 1px rgba(175,184,193,0.2);196 border-bottom-color: rgba(175,184,193,0.2);197 border-radius: 6px;198 box-shadow: inset 0 -1px 0 rgba(175,184,193,0.2);199}200.markdown-body h1,201.markdown-body h2,202.markdown-body h3,203.markdown-body h4,204.markdown-body h5,205.markdown-body h6 {206 margin-top: 24px;207 margin-bottom: 16px;208 font-weight: 600;209 line-height: 1.25;210}211.markdown-body h2 {212 font-weight: 600;213 padding-bottom: .3em;214 font-size: 1.5em;215 border-bottom: 1px solid hsla(210,18%,87%,1);216}217.markdown-body h3 {218 font-weight: 600;219 font-size: 1.25em;220}221.markdown-body h4 {222 font-weight: 600;223 font-size: 1em;224}225.markdown-body h5 {226 font-weight: 600;227 font-size: .875em;228}229.markdown-body h6 {230 font-weight: 600;231 font-size: .85em;232 color: #57606a;233}234.markdown-body p {235 margin-top: 0;236 margin-bottom: 10px;237}238.markdown-body blockquote {239 margin: 0;240 padding: 0 1em;241 color: #57606a;242 border-left: .25em solid #d0d7de;243}244.markdown-body ul,245.markdown-body ol {246 margin-top: 0;247 margin-bottom: 0;248 padding-left: 2em;249}250.markdown-body ol ol,251.markdown-body ul ol {252 list-style-type: lower-roman;253}254.markdown-body ul ul ol,255.markdown-body ul ol ol,256.markdown-body ol ul ol,257.markdown-body ol ol ol {258 list-style-type: lower-alpha;259}260.markdown-body dd {261 margin-left: 0;262}263.markdown-body tt,264.markdown-body code {265 font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;266 font-size: 12px;267}268.markdown-body pre {269 margin-top: 0;270 margin-bottom: 0;271 font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;272 font-size: 12px;273 word-wrap: normal;274}275.markdown-body :-ms-input-placeholder {276 color: #6e7781;277 opacity: 1;278}279.markdown-body ::-ms-input-placeholder {280 color: #6e7781;281 opacity: 1;282}283.markdown-body ::placeholder {284 color: #6e7781;285 opacity: 1;286}287.markdown-body .pl-c {288 color: #6e7781;289}290.markdown-body .pl-c1,291.markdown-body .pl-s .pl-v {292 color: #0550ae;293}294.markdown-body .pl-e,295.markdown-body .pl-en {296 color: #8250df;297}298.markdown-body .pl-smi,299.markdown-body .pl-s .pl-s1 {300 color: #24292f;301}302.markdown-body .pl-ent {303 color: #116329;304}305.markdown-body .pl-k {306 color: #cf222e;307}308.markdown-body .pl-s,309.markdown-body .pl-pds,310.markdown-body .pl-s .pl-pse .pl-s1,311.markdown-body .pl-sr,312.markdown-body .pl-sr .pl-cce,313.markdown-body .pl-sr .pl-sre,314.markdown-body .pl-sr .pl-sra {315 color: #0a3069;316}317.markdown-body .pl-v,318.markdown-body .pl-smw {319 color: #953800;320}321.markdown-body .pl-bu {322 color: #82071e;323}324.markdown-body .pl-ii {325 color: #f6f8fa;326 background-color: #82071e;327}328.markdown-body .pl-c2 {329 color: #f6f8fa;330 background-color: #cf222e;331}332.markdown-body .pl-sr .pl-cce {333 font-weight: bold;334 color: #116329;335}336.markdown-body .pl-ml {337 color: #3b2300;338}339.markdown-body .pl-mh,340.markdown-body .pl-mh .pl-en,341.markdown-body .pl-ms {342 font-weight: bold;343 color: #0550ae;344}345.markdown-body .pl-mi {346 font-style: italic;347 color: #24292f;348}349.markdown-body .pl-mb {350 font-weight: bold;351 color: #24292f;352}353.markdown-body .pl-md {354 color: #82071e;355 background-color: #FFEBE9;356}357.markdown-body .pl-mi1 {358 color: #116329;359 background-color: #dafbe1;360}361.markdown-body .pl-mc {362 color: #953800;363 background-color: #ffd8b5;364}365.markdown-body .pl-mi2 {366 color: #eaeef2;367 background-color: #0550ae;368}369.markdown-body .pl-mdr {370 font-weight: bold;371 color: #8250df;372}373.markdown-body .pl-ba {374 color: #57606a;375}376.markdown-body .pl-sg {377 color: #8c959f;378}379.markdown-body .pl-corl {380 text-decoration: underline;381 color: #0a3069;382}383.markdown-body [data-catalyst] {384 display: block;385}386.markdown-body g-emoji {387 font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";388 font-size: 1em;389 font-style: normal !important;390 font-weight: 400;391 line-height: 1;392 vertical-align: -0.075em;393}394.markdown-body g-emoji img {395 width: 1em;396 height: 1em;397}398.markdown-body::before {399 display: table;400 content: "";401}402.markdown-body::after {403 display: table;404 clear: both;405 content: "";406}407.markdown-body>*:first-child {408 margin-top: 0 !important;409}410.markdown-body>*:last-child {411 margin-bottom: 0 !important;412}413.markdown-body a:not([href]) {414 color: inherit;415 text-decoration: none;416}417.markdown-body .absent {418 color: #cf222e;419}420.markdown-body .anchor {421 float: left;422 padding-right: 4px;423 margin-left: -20px;424 line-height: 1;425}426.markdown-body .anchor:focus {427 outline: none;428}429.markdown-body p,430.markdown-body blockquote,431.markdown-body ul,432.markdown-body ol,433.markdown-body dl,434.markdown-body table,435.markdown-body pre,436.markdown-body details {437 margin-top: 0;438 margin-bottom: 16px;439}440.markdown-body blockquote>:first-child {441 margin-top: 0;442}443.markdown-body blockquote>:last-child {444 margin-bottom: 0;445}446.markdown-body sup>a::before {447 content: "[";448}449.markdown-body sup>a::after {450 content: "]";451}452.markdown-body h1 .octicon-link,453.markdown-body h2 .octicon-link,454.markdown-body h3 .octicon-link,455.markdown-body h4 .octicon-link,456.markdown-body h5 .octicon-link,457.markdown-body h6 .octicon-link {458 color: #24292f;459 vertical-align: middle;460 visibility: hidden;461}462.markdown-body h1:hover .anchor,463.markdown-body h2:hover .anchor,464.markdown-body h3:hover .anchor,465.markdown-body h4:hover .anchor,466.markdown-body h5:hover .anchor,467.markdown-body h6:hover .anchor {468 text-decoration: none;469}470.markdown-body h1:hover .anchor .octicon-link,471.markdown-body h2:hover .anchor .octicon-link,472.markdown-body h3:hover .anchor .octicon-link,473.markdown-body h4:hover .anchor .octicon-link,474.markdown-body h5:hover .anchor .octicon-link,475.markdown-body h6:hover .anchor .octicon-link {476 visibility: visible;477}478.markdown-body h1 tt,479.markdown-body h1 code,480.markdown-body h2 tt,481.markdown-body h2 code,482.markdown-body h3 tt,483.markdown-body h3 code,484.markdown-body h4 tt,485.markdown-body h4 code,486.markdown-body h5 tt,487.markdown-body h5 code,488.markdown-body h6 tt,489.markdown-body h6 code {490 padding: 0 .2em;491 font-size: inherit;492}493.markdown-body ul.no-list,494.markdown-body ol.no-list {495 padding: 0;496 list-style-type: none;497}498.markdown-body ol[type="1"] {499 list-style-type: decimal;500}501.markdown-body ol[type=a] {502 list-style-type: lower-alpha;503}504.markdown-body ol[type=i] {505 list-style-type: lower-roman;506}507.markdown-body div>ol:not([type]) {508 list-style-type: decimal;509}510.markdown-body ul ul,511.markdown-body ul ol,512.markdown-body ol ol,513.markdown-body ol ul {514 margin-top: 0;515 margin-bottom: 0;516}517.markdown-body li>p {518 margin-top: 16px;519}520.markdown-body li+li {521 margin-top: .25em;522}523.markdown-body dl {524 padding: 0;525}526.markdown-body dl dt {527 padding: 0;528 margin-top: 16px;529 font-size: 1em;530 font-style: italic;531 font-weight: 600;532}533.markdown-body dl dd {534 padding: 0 16px;535 margin-bottom: 16px;536}537.markdown-body table th {538 font-weight: 600;539}540.markdown-body table th,541.markdown-body table td {542 padding: 6px 13px;543 border: 1px solid #d0d7de;544}545.markdown-body table tr {546 background-color: #ffffff;547 border-top: 1px solid hsla(210,18%,87%,1);548}549.markdown-body table tr:nth-child(2n) {550 background-color: #f6f8fa;551}552.markdown-body table img {553 background-color: transparent;554}555.markdown-body img[align=right] {556 padding-left: 20px;557}558.markdown-body img[align=left] {559 padding-right: 20px;560}561.markdown-body .emoji {562 max-width: none;563 vertical-align: text-top;564 background-color: transparent;565}566.markdown-body span.frame {567 display: block;568 overflow: hidden;569}570.markdown-body span.frame>span {571 display: block;572 float: left;573 width: auto;574 padding: 7px;575 margin: 13px 0 0;576 overflow: hidden;577 border: 1px solid #d0d7de;578}579.markdown-body span.frame span img {580 display: block;581 float: left;582}583.markdown-body span.frame span span {584 display: block;585 padding: 5px 0 0;586 clear: both;587 color: #24292f;588}589.markdown-body span.align-center {590 display: block;591 overflow: hidden;592 clear: both;593}594.markdown-body span.align-center>span {595 display: block;596 margin: 13px auto 0;597 overflow: hidden;598 text-align: center;599}600.markdown-body span.align-center span img {601 margin: 0 auto;602 text-align: center;603}604.markdown-body span.align-right {605 display: block;606 overflow: hidden;607 clear: both;608}609.markdown-body span.align-right>span {610 display: block;611 margin: 13px 0 0;612 overflow: hidden;613 text-align: right;614}615.markdown-body span.align-right span img {616 margin: 0;617 text-align: right;618}619.markdown-body span.float-left {620 display: block;621 float: left;622 margin-right: 13px;623 overflow: hidden;624}625.markdown-body span.float-left span {626 margin: 13px 0 0;627}628.markdown-body span.float-right {629 display: block;630 float: right;631 margin-left: 13px;632 overflow: hidden;633}634.markdown-body span.float-right>span {635 display: block;636 margin: 13px auto 0;637 overflow: hidden;638 text-align: right;639}640.markdown-body code,641.markdown-body tt {642 padding: .2em .4em;643 margin: 0;644 font-size: 85%;645 background-color: rgba(175,184,193,0.2);646 border-radius: 6px;647}648.markdown-body code br,649.markdown-body tt br {650 display: none;651}652.markdown-body del code {653 text-decoration: inherit;654}655.markdown-body pre code {656 font-size: 100%;657}658.markdown-body pre>code {659 padding: 0;660 margin: 0;661 word-break: normal;662 white-space: pre;663 background: transparent;664 border: 0;665}666.markdown-body .highlight {667 margin-bottom: 16px;668}669.markdown-body .highlight pre {670 margin-bottom: 0;671 word-break: normal;672}673.markdown-body .highlight pre,674.markdown-body pre {675 padding: 16px;676 overflow: auto;677 font-size: 85%;678 line-height: 1.45;679 background-color: #f6f8fa;680 border-radius: 6px;681}682.markdown-body pre code,683.markdown-body pre tt {684 display: inline;685 max-width: auto;686 padding: 0;687 margin: 0;688 overflow: visible;689 line-height: inherit;690 word-wrap: normal;691 background-color: transparent;692 border: 0;693}694.markdown-body .csv-data td,695.markdown-body .csv-data th {696 padding: 5px;697 overflow: hidden;698 font-size: 12px;699 line-height: 1;700 text-align: left;701 white-space: nowrap;702}703.markdown-body .csv-data .blob-num {704 padding: 10px 8px 9px;705 text-align: right;706 background: #ffffff;707 border: 0;708}709.markdown-body .csv-data tr {710 border-top: 0;711}712.markdown-body .csv-data th {713 font-weight: 600;714 background: #f6f8fa;715 border-top: 0;716}717.markdown-body .footnotes {718 font-size: 12px;719 color: #57606a;720 border-top: 1px solid #d0d7de;721}722.markdown-body .footnotes ol {723 padding-left: 16px;724}725.markdown-body .footnotes li {726 position: relative;727}728.markdown-body .footnotes li:target::before {729 position: absolute;730 top: -8px;731 right: -8px;732 bottom: -8px;733 left: -24px;734 pointer-events: none;735 content: "";736 border: 2px solid #0969da;737 border-radius: 6px;738}739.markdown-body .footnotes li:target {740 color: #24292f;741}742.markdown-body .footnotes .data-footnote-backref g-emoji {743 font-family: monospace;744}745.markdown-body [hidden] {746 display: none !important;747}748.markdown-body ::-webkit-calendar-picker-indicator {749 filter: invert(50%);750}751`752const ROOT_NODE = 'markdown-body'753function loadScript(url, callback) {754 var script = document.createElement('script')755 script.type = 'text/javascript'756 if (script.readyState) {757 //IE758 script.onreadystatechange = function () {759 if (script.readyState == 'loaded' || script.readyState == 'complete') {760 script.onreadystatechange = null761 callback()762 }763 }764 } else {765 //Others766 script.onload = function () {767 callback()768 }769 }770 script.src = url771 script.async = false772 document.getElementsByTagName('head')[0].appendChild(script)773}774function onDependencyLoaded(markdown) {775 // manage stylesheet776 const styleElement = document.createElement('style')777 const styleContent = document.createTextNode(styles)778 styleElement.appendChild(styleContent)779 document.head.appendChild(styleElement)780 // manage md781 const element = document.createElement('div')782 element.setAttribute('class', ROOT_NODE)783 element.innerHTML = marked.parse(markdown[0])784 document.body.appendChild(element)785}786function markdown(markdown) {787 loadScript('https://cdn.jsdelivr.net/npm/marked/marked.min.js', onDependencyLoaded.bind(null, markdown))...

Full Screen

Full Screen

search.min.js

Source:search.min.js Github

copy

Full Screen

1// Indexador do lunr.js2(function ($) {3 $(document).ready(function() {4 window.index = lunr(function () {5 this.field('title', {boost: 10});6 this.field('body');7 this.ref('href');8 });9 window.index.pipeline.reset();10 window.index.add({11 href: 'https://markdown.net.br/introducao/',12 title: 'Introdução',13 body: 'O que é o Markdown, Por que usar o Markdown, Como funciona o Markdown, Para que serve o Markdown, Sabores do Markdown'14 });15 // Cria o indexador16 window.index.add({17 href: 'https://markdown.net.br/sintaxe-basica/',18 title: 'Sintaxe básica',19 body: 'Quase todos os aplicativos Markdown suportam a sintaxe básica descrita no documento de design original de John Gruber. Existem pequenas variações e discrepâncias entre os processadores Markdown - essas são anotadas em linha sempre que possível. Links, link'20 });21 window.index.add({22 href: 'https://markdown.net.br/sintaxe-estendida/',23 title: 'Sintaxe Estendida',24 body: 'A sintaxe básica descrita no documento de design original de John Gruber adicionou muitos dos elementos necessários no dia a dia, mas não foi suficiente para algumas pessoas. É aí que entra a sintaxe estendida. Vários indivíduos e organizações decidiram estender a sintaxe básica adicionando mais elementos, como tabelas, blocos de código, realce de sintaxe, vinculação automática de URL e notas de rodapé. Esses elementos podem ser ativados usando uma linguagem de marcação leve que se baseia na sintaxe básica do Markdown ou adicionando uma extensão a um processador Markdown compatível.'25 });26 window.index.add({27 href: 'https://markdown.net.br/referencia-rapida/',28 title: 'Referência Rápida, Folha de Dicas, Consulta Rápida',29 body: 'Uma referência rápida à sintaxe do Markdown. Esta folha de dicas do Markdown fornece uma visão geral rápida de todos os elementos que compõem a sintaxe da linguagem.'30 });31 window.index.add({32 href: 'https://markdown.net.br/ferramentas/',33 title: 'Ferramentas',34 body: 'Os melhore aplicativos, editor, extensões, plugins e componentes que são compatíveis com o Markdown. Este é um diretório abrangente de ferramentas relacionadas ao Markdown.'35 });36 window.index.add({37 href: 'https://markdown.net.br/ferramentas/bear/',38 title: 'Bear',39 body: 'O Bear é um aplicativo de anotações do Markdown para dispositivos macOS e iOS.'40 });41 window.index.add({42 href: 'https://markdown.net.br/ferramentas/boostnote/',43 title: 'Boostnote',44 body: 'O Boostnote é uma aplicação de anotação para desenvolvedore baseada no Markdown.'45 });46 window.index.add({47 href: 'https://markdown.net.br/ferramentas/byword/',48 title: 'Byword',49 body: 'O Byword é um editor de Markdown disponível para macOS e iOS.'50 });51 window.index.add({52 href: 'https://markdown.net.br/ferramentas/codimd/',53 title: 'Codimd',54 body: 'O CodiMD é um editor de Markdown que permite colaboração em tempo real, além de ser código fonte aberto.'55 });56 window.index.add({57 href: 'https://markdown.net.br/ferramentas/dillinger/',58 title: 'Dillinger',59 body: 'Dillinger é um editor de Markdown on-line projetado para que você possa editar Markdown em qualquer lugar.'60 });61 window.index.add({62 href: 'https://markdown.net.br/ferramentas/docusaurus/',63 title: 'Docusaurus',64 body: 'O Docusaurus converte arquivos Markdown em um site de documentação.'65 });66 window.index.add({67 href: 'https://markdown.net.br/ferramentas/ghost/',68 title: 'Ghost',69 body: 'O Ghost é um CMS de código aberto conhecido por sua velocidade, simplicidade e facilidade de uso.'70 });71 window.index.add({72 href: 'https://markdown.net.br/ferramentas/gitbook/',73 title: 'GitBook',74 body: 'O GitBook é uma solução de hospedagem para sites de documentação e bases de conhecimento.'75 });76 window.index.add({77 href: 'https://markdown.net.br/ferramentas/github-pages/',78 title: 'Github Pages',79 body: 'O GitHub Pages é um serviço gratuito que transforma arquivos Markdown em um site.'80 });81 window.index.add({82 href: 'https://markdown.net.br/ferramentas/hugo/',83 title: 'Hugo',84 body: 'Hugo é um gerador de site estático que converte arquivos Markdown em um site.'85 });86 window.index.add({87 href: 'https://markdown.net.br/ferramentas/ia-writer/',88 title: 'iA Writer',89 body: 'O iA Writer é um dos editores Markdown mais estabelecidos e amplamente aclamados.'90 });91 window.index.add({92 href: 'https://markdown.net.br/ferramentas/imdone/',93 title: 'Imdone',94 body: 'Imdone é um gerenciador de tarefas no estilo Kanban baseado em Markdown.'95 });96 window.index.add({97 href: 'https://markdown.net.br/ferramentas/jekyll/',98 title: 'Jekyll',99 body: 'O Jekyll é um gerador de site estático que converte arquivos Markdown em um site.'100 });101 window.index.add({102 href: 'https://markdown.net.br/ferramentas/joplin/',103 title: 'Joplin',104 body: 'Joplin é um aplicativo de anotações que respeita a sua privacidade.'105 });106 window.index.add({107 href: 'https://markdown.net.br/ferramentas/macdown/',108 title: 'MacDown',109 body: 'O MacDown é um dos melhores editores do Markdown disponíveis para o macOS.'110 });111 window.index.add({112 href: 'https://markdown.net.br/ferramentas/mark-text/',113 title: 'Mark Text',114 body: 'O Mark Text é um editor popular, gratuito e de código aberto desenvolvido para o Markdown.'115 });116 window.index.add({117 href: 'https://markdown.net.br/ferramentas/markdeep/',118 title: 'Markdeep',119 body: 'O Markdeep transforma qualquer arquivo do Markdown em um arquivo HTML independente.'120 });121 window.index.add({122 href: 'https://markdown.net.br/ferramentas/markdown-here/',123 title: 'Markdown Here',124 body: 'Markdown Here está uma extensão do navegador que converte o texto Markdown em formulários da web.'125 });126 window.index.add({127 href: 'https://markdown.net.br/ferramentas/mattermost/',128 title: 'Mattermost',129 body: 'O Mattermost é um aplicativo de mensagens e colaboração em equipe de código fonte aberto.'130 });131 window.index.add({132 href: 'https://markdown.net.br/ferramentas/mkdocs/',133 title: 'MkDocs',134 body: 'O MkDocs é um gerador de website estático para a criação de sites de documentação.'135 });136 window.index.add({137 href: 'https://markdown.net.br/ferramentas/madoko/',138 title: 'Madoko',139 body: 'Madoko é um aplicativo para escrever artigos profissionais e muito mais.'140 });141 window.index.add({142 href: 'https://markdown.net.br/ferramentas/notable/',143 title: 'Notable',144 body: 'Notable é uma aplicação de anotação básica com excelente suporte ao Markdown.'145 });146 window.index.add({147 href: 'https://markdown.net.br/ferramentas/notion/',148 title: 'Notion',149 body: 'O Notion é uma solução de gerenciamento de conhecimento "tudo em um" para todos.'150 });151 window.index.add({152 href: 'https://markdown.net.br/ferramentas/reddit/',153 title: 'Reddit',154 body: 'O Reddit é uma comunidade online popular que suporta postagem usando Markdown.'155 });156 window.index.add({157 href: 'https://markdown.net.br/ferramentas/simplenote/',158 title: 'Simplenote',159 body: 'Simplenote é um aplicativo de anotações Markdown multiplataforma.'160 });161 window.index.add({162 href: 'https://markdown.net.br/ferramentas/slack/',163 title: 'Slack',164 body: 'O Slack é um aplicativo de mensagens e colaboração em equipe.'165 });166 window.index.add({167 href: 'https://markdown.net.br/ferramentas/squarespace/',168 title: 'Squarespace',169 body: 'O Squarespace é um serviço popular baseado em assinatura para a criação de sites.'170 });171 window.index.add({172 href: 'https://markdown.net.br/ferramentas/stackedit/',173 title: 'StackEdit',174 body: 'O StackEdit é um poderoso editor de Markdown on-line que você pode usar em qualquer lugar.'175 });176 window.index.add({177 href: 'https://markdown.net.br/ferramentas/standard-notes/',178 title: 'Standard Notes',179 body: 'O Standard Notes é um aplicativo de anotações elegante e de código aberto.'180 });181 window.index.add({182 href: 'https://markdown.net.br/ferramentas/trello/',183 title: 'Trello',184 body: 'O Trello é um aplicativo de gerenciamento de projetos no estilo kanban.'185 });186 window.index.add({187 href: 'https://markdown.net.br/ferramentas/typora/',188 title: 'Typora',189 body: 'Typora é um editor simples e configurável, projetado para anotações e documentos.'190 });191 window.index.add({192 href: 'https://markdown.net.br/ferramentas/ulysses/',193 title: 'Ulysses',194 body: 'Ulysses é um aplicativo de escrita popular para dispositivos macOS e iOS.'195 });196 window.index.add({197 href: 'https://markdown.net.br/ferramentas/zettlr/',198 title: 'Zettlr',199 body: 'Zettlr é um editor de Markdown de código aberto desenvolvido para redação acadêmica.'200 });201 window.index.add({202 href: 'https://markdown.net.br/sabores/',203 title: 'Sabores',204 body: 'Essa é uma lista detalhada dos sabores, variações e alternativas da sintaxe do Markdown e como usá-las.'205 });206 window.index.add({207 href: 'https://markdown.net.br/sabores/gfm/',208 title: 'GFM',209 body: 'Github flavored Markdown, Esta especificação formal é baseada no CommonMark Spec de John MacFarlane e licenciada sob Creative Commons BY-SA. Sabor do Markdown do Github.'210 });211 // icon click212 $('ul#nav-mobile li.search .search-wrapper i.material-icons').click(function() {213 if ($('.search-results .focused').length) {214 $('.search-results .focused').first()[0].click();215 } else if ($('.search-results').children().length) {216 $('.search-results').children().first()[0].click();217 }218 });219 var renderResults = function(results) {220 var resultsContainer = $('.search-results');221 resultsContainer.empty();222 Array.prototype.forEach.call(results, function(result) {223 var resultDiv = $('<a href="' + result[1] + '">' + result[0] + '</a>');224 resultsContainer.append(resultDiv);225 });226 };227 var debounce = function (fn) {228 var timeout;229 return function () {230 var args = Array.prototype.slice.call(arguments),231 ctx = this;232 clearTimeout(timeout);233 timeout = setTimeout(function () {234 fn.apply(ctx, args);235 }, 100);236 };237 };238 $('input#search').focus(function() { $(this).parent().addClass('focused'); });239 $('input#search').blur(function() {240 if (!$(this).val()) {241 $(this).parent().removeClass('focused');242 }243 });244 $('input#search').on('keyup', debounce(function (e) {245 if ($(this).val() < 2) {246 renderResults([]);247 return;248 }249 if (e.which === 38 || e.which === 40 || e.keyCode === 13) return;250 String.prototype.trimRight = function(charlist) {251 if (charlist === undefined)252 charlist = "\s";253 return this.replace(new RegExp("[" + charlist + "]+$"), "");254 };255 var query = $(this).val();256 var results = window.index.search(query).slice(0, 6).map(function (result) {257 var href = result.ref.split('https://markdown.net.br/')[1];258 console.log(result);259 href = href.trimRight("/");260 // alert(href);261 href = href.replace("/", ' <i class="fas fa-chevron-right" style="margin: 0 5px;color: #989898;"></i> ')262 // alert(href);263 return [href, result.ref];264 });265 renderResults(results);266 }));267 $('input#search').on('keydown', debounce(function (e) {268 // Escape.269 if (e.keyCode === 27) {270 $(this).val('');271 $(this).blur();272 renderResults([]);273 return;274 } else if (e.keyCode === 13) {275 // enter276 if ($('.search-results .focused').length) {277 $('.search-results .focused').first()[0].click();278 } else if ($('.search-results').children().length) {279 $('.search-results').children().first()[0].click();280 }281 return;282 }283 // Arrow keys.284 var focused;285 switch(e.which) {286 case 38: // up287 if ($('.search-results .focused').length) {288 focused = $('.search-results .focused');289 focused.removeClass('focused');290 focused.prev().addClass('focused');291 }292 break;293 case 40: // down294 if (!$('.search-results .focused').length) {295 focused = $('.search-results').children().first();296 focused.addClass('focused');297 } else {298 focused = $('.search-results .focused');299 if (focused.next().length) {300 focused.removeClass('focused');301 focused.next().addClass('focused');302 }303 }304 break;305 default: return; // exit this handler for other keys306 }307 e.preventDefault();308 }));309 });...

Full Screen

Full Screen

plugin.js

Source:plugin.js Github

copy

Full Screen

...146 return new Promise( function( resolve ) {147 var externalPromises = [];148 [].slice.call( scope.querySelectorAll( '[data-markdown]:not([data-markdown-parsed])') ).forEach( function( section, i ) {149 if( section.getAttribute( 'data-markdown' ).length ) {150 externalPromises.push( loadExternalMarkdown( section ).then(151 // Finished loading external file152 function( xhr, url ) {153 section.outerHTML = slidify( xhr.responseText, {154 separator: section.getAttribute( 'data-separator' ),155 verticalSeparator: section.getAttribute( 'data-separator-vertical' ),156 notesSeparator: section.getAttribute( 'data-separator-notes' ),157 attributes: getForwardedAttributes( section )158 });159 },160 // Failed to load markdown161 function( xhr, url ) {162 section.outerHTML = '<section data-state="alert">' +163 'ERROR: The attempt to fetch ' + url + ' failed with HTTP status ' + xhr.status + '.' +164 'Check your browser\'s JavaScript console for more details.' +165 '<p>Remember that you need to serve the presentation HTML from a HTTP server.</p>' +166 '</section>';167 }168 ) );169 }170 else if( section.getAttribute( 'data-separator' ) || section.getAttribute( 'data-separator-vertical' ) || section.getAttribute( 'data-separator-notes' ) ) {171 section.outerHTML = slidify( getMarkdownFromSlide( section ), {172 separator: section.getAttribute( 'data-separator' ),173 verticalSeparator: section.getAttribute( 'data-separator-vertical' ),174 notesSeparator: section.getAttribute( 'data-separator-notes' ),175 attributes: getForwardedAttributes( section )176 });177 }178 else {179 section.innerHTML = createMarkdownSlide( getMarkdownFromSlide( section ) );180 }181 });182 Promise.all( externalPromises ).then( resolve );183 } );184 }185 function loadExternalMarkdown( section ) {186 return new Promise( function( resolve, reject ) {187 var xhr = new XMLHttpRequest(),188 url = section.getAttribute( 'data-markdown' );189 var datacharset = section.getAttribute( 'data-charset' );190 // see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes191 if( datacharset != null && datacharset != '' ) {192 xhr.overrideMimeType( 'text/html; charset=' + datacharset );193 }194 xhr.onreadystatechange = function( section, xhr ) {195 if( xhr.readyState === 4 ) {196 // file protocol yields status code 0 (useful for local debug, mobile applications etc.)197 if ( ( xhr.status >= 200 && xhr.status < 300 ) || xhr.status === 0 ) {198 resolve( xhr, url );199 }...

Full Screen

Full Screen

preview_markdown.js

Source:preview_markdown.js Github

copy

Full Screen

1/* eslint-disable func-names, no-var, object-shorthand, comma-dangle, prefer-arrow-callback */2// MarkdownPreview3//4// Handles toggling the "Write" and "Preview" tab clicks, rendering the preview5// (including the explanation of quick actions), and showing a warning when6// more than `x` users are referenced.7//8(function () {9 var lastTextareaPreviewed;10 var lastTextareaHeight = null;11 var markdownPreview;12 var previewButtonSelector;13 var writeButtonSelector;14 window.MarkdownPreview = (function () {15 function MarkdownPreview() {}16 // Minimum number of users referenced before triggering a warning17 MarkdownPreview.prototype.referenceThreshold = 10;18 MarkdownPreview.prototype.emptyMessage = 'Nothing to preview.';19 MarkdownPreview.prototype.ajaxCache = {};20 MarkdownPreview.prototype.showPreview = function ($form) {21 var mdText;22 var preview = $form.find('.js-md-preview');23 var url = preview.data('url');24 if (preview.hasClass('md-preview-loading')) {25 return;26 }27 mdText = $form.find('textarea.markdown-area').val();28 if (mdText.trim().length === 0) {29 preview.text(this.emptyMessage);30 this.hideReferencedUsers($form);31 } else {32 preview.addClass('md-preview-loading').text('Loading...');33 this.fetchMarkdownPreview(mdText, url, (function (response) {34 var body;35 if (response.body.length > 0) {36 body = response.body;37 } else {38 body = this.emptyMessage;39 }40 preview.removeClass('md-preview-loading').html(body);41 preview.renderGFM();42 this.renderReferencedUsers(response.references.users, $form);43 if (response.references.commands) {44 this.renderReferencedCommands(response.references.commands, $form);45 }46 }).bind(this));47 }48 };49 MarkdownPreview.prototype.fetchMarkdownPreview = function (text, url, success) {50 if (!url) {51 return;52 }53 if (text === this.ajaxCache.text) {54 success(this.ajaxCache.response);55 return;56 }57 $.ajax({58 type: 'POST',59 url: url,60 data: {61 text: text62 },63 dataType: 'json',64 success: (function (response) {65 this.ajaxCache = {66 text: text,67 response: response68 };69 success(response);70 }).bind(this)71 });72 };73 MarkdownPreview.prototype.hideReferencedUsers = function ($form) {74 $form.find('.referenced-users').hide();75 };76 MarkdownPreview.prototype.renderReferencedUsers = function (users, $form) {77 var referencedUsers;78 referencedUsers = $form.find('.referenced-users');79 if (referencedUsers.length) {80 if (users.length >= this.referenceThreshold) {81 referencedUsers.show();82 referencedUsers.find('.js-referenced-users-count').text(users.length);83 } else {84 referencedUsers.hide();85 }86 }87 };88 MarkdownPreview.prototype.hideReferencedCommands = function ($form) {89 $form.find('.referenced-commands').hide();90 };91 MarkdownPreview.prototype.renderReferencedCommands = function (commands, $form) {92 var referencedCommands;93 referencedCommands = $form.find('.referenced-commands');94 if (commands.length > 0) {95 referencedCommands.html(commands);96 referencedCommands.show();97 } else {98 referencedCommands.html('');99 referencedCommands.hide();100 }101 };102 return MarkdownPreview;103 }());104 markdownPreview = new window.MarkdownPreview();105 previewButtonSelector = '.js-md-preview-button';106 writeButtonSelector = '.js-md-write-button';107 lastTextareaPreviewed = null;108 $.fn.setupMarkdownPreview = function () {109 var $form = $(this);110 $form.find('textarea.markdown-area').on('input', function () {111 markdownPreview.hideReferencedUsers($form);112 });113 };114 $(document).on('markdown-preview:show', function (e, $form) {115 if (!$form) {116 return;117 }118 lastTextareaPreviewed = $form.find('textarea.markdown-area');119 lastTextareaHeight = lastTextareaPreviewed.height();120 // toggle tabs121 $form.find(writeButtonSelector).parent().removeClass('active');122 $form.find(previewButtonSelector).parent().addClass('active');123 // toggle content124 $form.find('.md-write-holder').hide();125 $form.find('.md-preview-holder').show();126 markdownPreview.showPreview($form);127 });128 $(document).on('markdown-preview:hide', function (e, $form) {129 if (!$form) {130 return;131 }132 lastTextareaPreviewed = null;133 if (lastTextareaHeight) {134 $form.find('textarea.markdown-area').height(lastTextareaHeight);135 }136 // toggle tabs137 $form.find(writeButtonSelector).parent().addClass('active');138 $form.find(previewButtonSelector).parent().removeClass('active');139 // toggle content140 $form.find('.md-write-holder').show();141 $form.find('textarea.markdown-area').focus();142 $form.find('.md-preview-holder').hide();143 markdownPreview.hideReferencedCommands($form);144 });145 $(document).on('markdown-preview:toggle', function (e, keyboardEvent) {146 var $target;147 $target = $(keyboardEvent.target);148 if ($target.is('textarea.markdown-area')) {149 $(document).triggerHandler('markdown-preview:show', [$target.closest('form')]);150 keyboardEvent.preventDefault();151 } else if (lastTextareaPreviewed) {152 $target = lastTextareaPreviewed;153 $(document).triggerHandler('markdown-preview:hide', [$target.closest('form')]);154 keyboardEvent.preventDefault();155 }156 });157 $(document).on('click', previewButtonSelector, function (e) {158 var $form;159 e.preventDefault();160 $form = $(this).closest('form');161 $(document).triggerHandler('markdown-preview:show', [$form]);162 });163 $(document).on('click', writeButtonSelector, function (e) {164 var $form;165 e.preventDefault();166 $form = $(this).closest('form');167 $(document).triggerHandler('markdown-preview:hide', [$form]);168 });...

Full Screen

Full Screen

markdown.js

Source:markdown.js Github

copy

Full Screen

...73 var xhr = new XMLHttpRequest(),74 url = section.getAttribute('data-markdown');75 xhr.onreadystatechange = function () {76 if( xhr.readyState === 4 ) {77 section.outerHTML = slidifyMarkdown( xhr.responseText, section.getAttribute('data-separator'), section.getAttribute('data-vertical') );78 }79 };80 xhr.open('GET', url, false);81 xhr.send();82 } else if( section.getAttribute('data-separator') ) {83 var markdown = stripLeadingWhitespace(section);84 section.outerHTML = slidifyMarkdown( markdown, section.getAttribute('data-separator'), section.getAttribute('data-vertical') );85 }86 }87 };88 var queryMarkdownSlides = function() {89 var sections = document.querySelectorAll( '[data-markdown]');90 for( var j = 0, jlen = sections.length; j < jlen; j++ ) {91 makeHtml(sections[j]);92 }93 };94 var makeHtml = function(section) {95 var notes = section.querySelector( 'aside.notes' );96 var markdown = stripLeadingWhitespace(section);97 section.innerHTML = (new Showdown.converter()).makeHtml(markdown);98 if( notes ) {99 section.appendChild( notes );100 }101 };102 querySlidingMarkdown();103 queryMarkdownSlides();...

Full Screen

Full Screen

buttons.stories.js

Source:buttons.stories.js Github

copy

Full Screen

1import '../../css/utils.css';2import { storiesOf } from '@storybook/svelte';3import { action } from '@storybook/addon-actions';4import ButtonOutline from '../../components/buttons/ButtonOutline.svelte';5import ButtonPill from '../../components/buttons/ButtonPill.svelte';6import ButtonSimple from '../../components/buttons/ButtonSimple.svelte';7import ButtonBordered from '../../components/buttons/ButtonBordered.svelte';8import ButtonDisabled from '../../components/buttons/ButtonDisabled.svelte';9import Button3D from '../../components/buttons/Button3D.svelte';10import ButtonElevated from '../../components/buttons/ButtonElevated.svelte';11import ButtonGroups from '../../components/buttons/ButtonGroups.svelte';12import ButtonIcon from '../../components/buttons/ButtonIcon.svelte';13import markdownNotes from './buttons.stories.md';14storiesOf('Buttons | Buttons', module)15 //Simple Button16 .add(17 'Simple',18 () => ({19 Component: ButtonSimple,20 props: { text: 'Button' },21 on: {22 customEventHandler: action('This custom event handler works'),23 },24 }),25 { notes: { markdown: markdownNotes } },26 )27 //Pill Button28 .add(29 'Pill Button',30 () => ({31 Component: ButtonPill,32 props: { text: 'Button' },33 }),34 { notes: { markdown: markdownNotes } },35 )36 //Outline Button37 .add(38 'Outline Button',39 () => ({40 Component: ButtonOutline,41 props: { text: 'Button' },42 }),43 { notes: { markdown: markdownNotes } },44 )45 //Bordered Button46 .add(47 'Bordered Button',48 () => ({49 Component: ButtonBordered,50 props: { text: 'Button' },51 }),52 { notes: { markdown: markdownNotes } },53 )54 //Disabled Button55 .add(56 'Disabled Button',57 () => ({58 Component: ButtonDisabled,59 props: { text: 'Button' },60 }),61 { notes: { markdown: markdownNotes } },62 )63 //3D Button64 .add(65 '3D Button',66 () => ({67 Component: Button3D,68 props: { text: 'Button' },69 }),70 { notes: { markdown: markdownNotes } },71 )72 //Elevated Button73 .add(74 'Elevated Button',75 () => ({76 Component: ButtonElevated,77 props: { text: 'Button' },78 }),79 { notes: { markdown: markdownNotes } },80 )81 //Button Groups82 .add(83 'Button Groups',84 () => ({85 Component: ButtonGroups,86 props: { prev: 'Prev', next: 'Next' },87 }),88 { notes: { markdown: markdownNotes } },89 )90 //Button Icon91 .add(92 'Button Icon',93 () => ({94 Component: ButtonIcon,95 props: { text: 'Download' },96 }),97 { notes: { markdown: markdownNotes } },...

Full Screen

Full Screen

utils.js

Source:utils.js Github

copy

Full Screen

...27 // Check if view has correct data.28 expect( html ).to.equal( viewString );29 // Check if converting back gives the same result.30 const normalized = typeof normalizedMarkdown !== 'undefined' ? normalizedMarkdown : markdown;31 expect( cleanMarkdown( dataProcessor.toData( viewFragment ) ) ).to.equal( normalized );32}33function cleanHtml( html ) {34 // Space between table elements.35 html = html.replace( /(th|td|tr)>\s+<(\/?(?:th|td|tr))/g, '$1><$2' );36 return html;37}38function cleanMarkdown( markdown ) {39 // Trim spaces at the end of the lines.40 markdown = markdown.replace( / +$/gm, '' );41 // Trim linebreak at the very beginning.42 markdown = markdown.replace( /^\s+/g, '' );43 return markdown;...

Full Screen

Full Screen

functions.js

Source:functions.js Github

copy

Full Screen

1const { snakeCase, replace } = require('lodash');2const { Organization } = require('@aasaam/information');3const safeName = (name) =>4 snakeCase(5 name6 .toLocaleLowerCase()7 .replace(/[^a-z0-9]/g, ' ')8 .trim(),9 );10const replaceDocument = (doc, params) => {11 let markdown = doc;12 markdown = replace(markdown, /INTERMEDIATE_NAME/g, params.INTERMEDIATE_NAME);13 markdown = replace(markdown, /CLIENT_EMAIL/g, params.CLIENT_EMAIL);14 markdown = replace(markdown, /CLIENT_NAME/g, params.CLIENT_NAME);15 markdown = replace(markdown, /PASSWORD/g, params.PASSWORD);16 markdown = replace(17 markdown,18 /EXPIRE_DATE/g,19 new Date(params.EXPIRE_DATE).toString(),20 );21 markdown = replace(markdown, /DATE/g, new Date().toString());22 markdown = replace(markdown, /PROVIDER_NAME/g, Organization.en.legalName);23 markdown = replace(markdown, /PROVIDER_WEBSITE/g, Organization.en.url);24 markdown = replace(markdown, /PROVIDER_TEL/g, Organization.en.telephone);25 markdown = replace(markdown, /PROVIDER_EMAIL/g, Organization.en.email);26 return markdown;27};28module.exports = {29 safeName,30 replaceDocument,...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var assert = require('assert');2var expect = require('chai').expect;3describe('Array', function() {4 describe('#indexOf()', function() {5 it('should return -1 when the value is not present', function() {6 assert.equal([1,2,3].indexOf(4), -1);7 });8 });9});10var assert = require('assert');11var expect = require('chai').expect;12describe('Array', function() {13 describe('#indexOf()', function() {14 it('should return -1 when the value is not present', function() {15 assert.equal([1,2,3].indexOf(4), -1);16 });17 });18});19var assert = require('assert');20var expect = require('chai').expect;21suite('Array', function() {22 suite('#indexOf()', function() {23 test('should return -1 when the value is not present', function() {24 assert.equal([1,2,3].indexOf(4), -1);25 });26 });27});28var assert = require('assert');29var expect = require('chai').expect;30var should = require('chai').should();31suite('Array', function() {32 suite('#indexOf()', function() {33 test('should return -1 when the value is not present', function() {34 assert.equal([1,2,3].indexOf(4), -1);35 });36 });37});38var assert = require('assert');39var expect = require('chai').expect;40var should = require('chai').should();41suite('Array', function() {42 suite('#indexOf()', function() {43 test('should return -1 when the value is not present', function() {44 assert.equal([1,2,3].indexOf(4), -1);45 });46 });47});48var assert = require('assert');49var expect = require('chai').expect;50suite('Array', function() {51 suite('#indexOf()', function() {52 test('should return -1 when

Full Screen

Using AI Code Generation

copy

Full Screen

1var assert = require('assert');2var chai = require('chai');3var expect = chai.expect;4var should = chai.should();5var assert = require('assert');6var chai = require('chai');7var expect = chai.expect;8var should = chai.should();9var assert = require('assert');10var chai = require('chai');11var expect = chai.expect;12var should = chai.should();13var assert = require('assert');14var chai = require('chai');15var expect = chai.expect;16var should = chai.should();17var assert = require('assert');18var chai = require('chai');19var expect = chai.expect;20var should = chai.should();21var assert = require('assert');22var chai = require('chai');23var expect = chai.expect;24var should = chai.should();25var assert = require('assert');26var chai = require('chai');27var expect = chai.expect;28var should = chai.should();29var assert = require('assert');30var chai = require('chai');31var expect = chai.expect;32var should = chai.should();33var assert = require('assert');34var chai = require('chai');35var expect = chai.expect;36var should = chai.should();

Full Screen

Using AI Code Generation

copy

Full Screen

1var assert = require('assert');2var Markdown = require('../markdown.js').Markdown;3describe('Markdown', function() {4 describe('#toHTML()', function() {5 it('should convert # to h1', function() {6 assert.equal('<h1>Header</h1>', Markdown.toHTML('#Header'));7 });8 it('should convert ## to h2', function() {9 assert.equal('<h2>Header</h2>', Markdown.toHTML('##Header'));10 });11 it('should convert ### to h3', function() {12 assert.equal('<h3>Header</h3>', Markdown.toHTML('###Header'));13 });14 it('should convert #### to h4', function() {15 assert.equal('<h4>Header</h4>', Markdown.toHTML('####Header'));16 });17 it('should convert ##### to h5', function() {18 assert.equal('<h5>Header</h5>', Markdown.toHTML('#####Header'));19 });20 it('should convert ###### to h6', function() {21 assert.equal('<h6>Header</h6>', Markdown.toHTML('######Header'));22 });23 it('should convert ** to strong', function() {24 assert.equal('<strong>strong</strong>', Markdown.toHTML('**strong**'));25 });26 it('should convert * to emphasis', function() {27 assert.equal('<em>emphasis</em>', Markdown.toHTML('*emphasis*'));28 });29 it('should convert _ to emphasis', function() {30 assert.equal('<em>emphasis</em>', Markdown.toHTML('_emphasis_'));31 });32 it('should convert __ to strong', function() {33 assert.equal('<strong>strong</strong>', Markdown.toHTML('__strong__'));34 });35 it('should convert ~ to strikethrough', function() {36 assert.equal('<del>strikethrough</del>', Markdown.toHTML('~~strikethrough~~'));37 });38 it('should convert > to blockquote', function() {39 assert.equal('<blockquote>blockquote</blockquote>', Markdown.toHTML('>blockquote'));40 });41 it('should convert * to list', function() {42 assert.equal('<ul><li>list</li></ul>', Markdown.toHTML('*list'));43 });44 it('should convert - to list', function() {45 assert.equal('<ul><li>list</li></ul>', Markdown.toHTML('-

Full Screen

Using AI Code Generation

copy

Full Screen

1var chai = require('chai');2var chaiHttp = require('chai-http');3var expect = chai.expect;4var should = chai.should();5chai.use(chaiHttp);6var server = require('../app');7describe('Testing Express Server', function() {8 it('should return 200', function(done) {9 chai.request(server)10 .get('/')11 .end(function(err, res) {12 res.should.have.status(200);13 done();14 });15 });16 it('should return 404', function(done) {17 chai.request(server)18 .get('/404')19 .end(function(err, res) {20 res.should.have.status(404);21 done();22 });23 });24});25var express = require('express');26var app = express();27app.get('/', function(req, res) {28 res.send('Hello World');29});30app.listen(3000, function() {31 console.log('Example app listening on port 3000!');32});33{34 "scripts": {35 },36 "dependencies": {37 }38}

Full Screen

Using AI Code Generation

copy

Full Screen

1var markdown = require('mocha-markdown')();2describe('My test suite', function() {3 markdown('test.md');4});5describe('My test suite', function() {6 it('should pass', function() {7 assert(true);8 });9});10var markdown = require('mocha-markdown')();11describe('My test suite', function() {12 markdown('test.md');13});14describe('My test suite', function() {15 it('should pass', function() {16 assert(true);17 });18});19var markdown = require('mocha-markdown')();20describe('My test suite', function() {21 markdown('test.md');22});23describe('My test suite', function() {24 it('should pass', function() {25 assert(true);26 });27});28var markdown = require('mocha-markdown')();29describe('My test suite', function() {30 markdown('test.md');31});32describe('My test suite', function() {33 it('should pass', function() {34 assert(true);35 });36});

Full Screen

Using AI Code Generation

copy

Full Screen

1var assert = require('assert');2var expect = require('chai').expect;3var should = require('chai').should();4var myModule = require('../index.js');5describe('Test cases for the module', function(){6 it('Should return the sum of the two numbers', function(){7 var add = myModule(10, 20);8 expect(add).to.equal(30);9 });10 it('Should return the sum of the two numbers', function(){11 var add = myModule(10, 20);12 add.should.equal(30);13 });14});15module.exports = function(a, b){16 return a + b;17};18{19 "scripts": {20 },21 "dependencies": {22 }23}

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Mocha automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful