mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
Merge pull request #1922 from umap-project/smaller-headings
chore: smaller headings in descriptions
This commit is contained in:
commit
9fabfe08cd
2 changed files with 8 additions and 8 deletions
|
@ -124,9 +124,9 @@ export function toHTML(r, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// headings and hr
|
// headings and hr
|
||||||
r = r.replace(/^### (.*)(\r\n|\r|\n)?/gm, '<h5>$1</h5>')
|
r = r.replace(/^### (.*)(\r\n|\r|\n)?/gm, '<h6>$1</h6>')
|
||||||
r = r.replace(/^## (.*)(\r\n|\r|\n)?/gm, '<h4>$1</h4>')
|
r = r.replace(/^## (.*)(\r\n|\r|\n)?/gm, '<h5>$1</h5>')
|
||||||
r = r.replace(/^# (.*)(\r\n|\r|\n)?/gm, '<h3>$1</h3>')
|
r = r.replace(/^# (.*)(\r\n|\r|\n)?/gm, '<h4>$1</h4>')
|
||||||
r = r.replace(/^---/gm, '<hr>')
|
r = r.replace(/^---/gm, '<hr>')
|
||||||
|
|
||||||
// bold, italics
|
// bold, italics
|
||||||
|
|
|
@ -11,14 +11,14 @@ global.JSDOM = JSDOM
|
||||||
describe('Utils', function () {
|
describe('Utils', function () {
|
||||||
describe('#toHTML()', function () {
|
describe('#toHTML()', function () {
|
||||||
it('should handle title', function () {
|
it('should handle title', function () {
|
||||||
assert.equal(Utils.toHTML('# A title'), '<h3>A title</h3>')
|
assert.equal(Utils.toHTML('# A title'), '<h4>A title</h4>')
|
||||||
})
|
})
|
||||||
it('should handle title followed by text', function () {
|
it('should handle title followed by text', function () {
|
||||||
assert.equal(Utils.toHTML('# A title\nSome text.'), '<h3>A title</h3>Some text.')
|
assert.equal(Utils.toHTML('# A title\nSome text.'), '<h4>A title</h4>Some text.')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should handle title in the middle of the content', function () {
|
it('should handle title in the middle of the content', function () {
|
||||||
assert.equal(Utils.toHTML('A phrase\n## A title'), 'A phrase\n<h4>A title</h4>')
|
assert.equal(Utils.toHTML('A phrase\n## A title'), 'A phrase\n<h5>A title</h5>')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should handle hr', function () {
|
it('should handle hr', function () {
|
||||||
|
@ -43,7 +43,7 @@ describe('Utils', function () {
|
||||||
it('should handle simple link in title', function () {
|
it('should handle simple link in title', function () {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
Utils.toHTML('# http://osm.org'),
|
Utils.toHTML('# http://osm.org'),
|
||||||
'<h3><a href="http://osm.org" target="_blank">http://osm.org</a></h3>'
|
'<h4><a href="http://osm.org" target="_blank">http://osm.org</a></h4>'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ describe('Utils', function () {
|
||||||
it('title followed by bullet points', function () {
|
it('title followed by bullet points', function () {
|
||||||
assert.equal(
|
assert.equal(
|
||||||
Utils.toHTML('## Some title\n* First *point*\n* Second **point**\n* Last [[https://here.org|point]]'),
|
Utils.toHTML('## Some title\n* First *point*\n* Second **point**\n* Last [[https://here.org|point]]'),
|
||||||
'<h4>Some title</h4><ul><li>First <em>point</em></li><li>Second <strong>point</strong></li><li>Last <a href="https://here.org" target="_blank">point</a></li></ul>'
|
'<h5>Some title</h5><ul><li>First <em>point</em></li><li>Second <strong>point</strong></li><li>Last <a href="https://here.org" target="_blank">point</a></li></ul>'
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue