mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
All the docs related files (docs-app, doc-gen, content, etc)
are now to be found inside the `/aio` folder.
The related gulp tasks have been moved from the top level
gulp file to a new one inside the `/aio` folder.
The structure of the `/aio` folder now looks like:
```
/aio/
build/ # gulp tasks
content/ #MARKDOWN FILES for devguides, cheatsheet, etc
devguides/
cheatsheets/
transforms/ #dgeni packages, templates, etc
src/
app/
assets/
content/ #HTML + JSON build artifacts produced by dgeni from /aio/content.
#This dir is .gitignored-ed
e2e/ #protractor tests for the doc viewer app
node_modules/ #dependencies for both the doc viewer builds and the dgeni stuff
#This dir is .gitignored-ed
gulpfile.js #Tasks for generating docs and building & deploying the doc viewer
```
Closes #14361
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
const renderMarkdownFactory = require('./renderMarkdown');
|
|
const renderMarkdown = renderMarkdownFactory();
|
|
|
|
describe('rho: renderMarkdown service', () => {
|
|
it('should convert markdown to HTML', () => {
|
|
const content = '# heading 1\n' +
|
|
'\n' +
|
|
'A paragraph with *bold* and _italic_.\n' +
|
|
'\n' +
|
|
'* List item 1\n' +
|
|
'* List item 2';
|
|
const output = renderMarkdown(content);
|
|
|
|
expect(output).toEqual(
|
|
'<h1>heading 1</h1>\n' +
|
|
'<p>A paragraph with <strong>bold</strong> and <em>italic</em>.</p>\n' +
|
|
'<ul>\n' +
|
|
' <li>List item 1</li>\n' +
|
|
' <li>List item 2</li>\n' +
|
|
'</ul>\n');
|
|
});
|
|
|
|
it('should not process markdown inside inline tags', () => {
|
|
const content = '# heading {@link some_url_path}';
|
|
const output = renderMarkdown(content);
|
|
expect(output).toEqual('<h1>heading {@link some_url_path}</h1>\n');
|
|
});
|
|
|
|
it('should not put block level inline tags inside paragraphs', () => {
|
|
const content = 'A paragraph.\n' +
|
|
'\n' +
|
|
'{@example blah **blah** blah }\n' +
|
|
'\n' +
|
|
'Another paragraph';
|
|
const output = renderMarkdown(content);
|
|
expect(output).toEqual(
|
|
'<p>A paragraph.</p>\n' +
|
|
'<div>{@example blah **blah** blah }</div>\n' +
|
|
'<p>Another paragraph</p>\n');
|
|
});
|
|
});
|