Skip to content

Commit 1496683

Browse files
authored
Fix marked import (#24)
1 parent a35b4c3 commit 1496683

File tree

5 files changed

+29
-167
lines changed

5 files changed

+29
-167
lines changed

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,6 @@ npm install ng2-markdown-to-html --save
1515

1616
## Configuration
1717

18-
To activate markdown parsing you will need to add [marked](https://github.com/chjj/marked) to to your application.
19-
20-
If you are using [Angular CLI](https://cli.angular.io/) you can follow the example below...
21-
22-
#### .angular-cli.json
23-
24-
```diff
25-
"scripts": [
26-
+ "../node_modules/marked/lib/marked.js"
27-
],
28-
```
29-
3018
To activate [Prism.js](http://prismjs.com/) synthax highlight you will need to choose a css theme file from `node_modules/prismjs/themes` directory and add it to your application along with `@types/prismjs` types file.
3119

3220
> Note that you can also find additional themes by browsing the web such as [Prism-Themes](https://github.com/PrismJS/prism-themes) or [Mokokai](https://github.com/Ahrengot/Monokai-theme-for-Prism.js) for example.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
},
5151
"private": false,
5252
"dependencies": {
53-
"@types/marked": "0.0.28",
53+
"@types/marked": "0.3.0",
5454
"@types/prismjs": "^1.6.0",
5555
"marked": "^0.3.6",
5656
"prismjs": "^1.6.0"

src/app/markdown-to-html/markdown-to-html.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { AfterViewInit, Component, ElementRef, Input, OnChanges, SimpleChanges } from '@angular/core';
22
import { MarkdownToHtmlService } from './markdown-to-html.service';
33

4+
// workaround to fix rollup namespace import
5+
// https://github.com/rollup/rollup/issues/670#issuecomment-284621537
6+
import * as _marked from 'marked';
7+
const marked = _marked;
8+
49
import * as Prism from 'prismjs';
510

611
import 'prismjs/prism';

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"sourceMap": true,
66
"declaration": false,
77
"moduleResolution": "node",
8+
"allowSyntheticDefaultImports": true,
89
"emitDecoratorMetadata": true,
910
"experimentalDecorators": true,
1011
"target": "es5",

yarn.lock

Lines changed: 22 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@
132132
version "2.5.38"
133133
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.5.38.tgz#a4379124c4921d4e21de54ec74669c9e9b356717"
134134

135-
"@types/marked@0.0.28":
136-
version "0.0.28"
137-
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.0.28.tgz#44ba754e9fa51432583e8eb30a7c4dd249b52faa"
135+
"@types/marked@0.3.0":
136+
version "0.3.0"
137+
resolved "https://registry.yarnpkg.com/@types/marked/-/marked-0.3.0.tgz#583c223dd33385a1dda01aaf77b0cd0411c4b524"
138138

139139
"@types/node@^6.0.46", "@types/node@~6.0.60":
140140
version "6.0.65"
@@ -196,7 +196,7 @@ ajv-keywords@^1.1.1:
196196
version "1.5.1"
197197
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
198198

199-
ajv@^4.11.2, ajv@^4.7.0, ajv@^4.9.1:
199+
ajv@^4.11.2, ajv@^4.7.0:
200200
version "4.11.5"
201201
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.5.tgz#b6ee74657b993a01dce44b7944d56f485828d5bd"
202202
dependencies:
@@ -389,7 +389,7 @@ async-foreach@^0.1.3:
389389
version "0.1.3"
390390
resolved "https://registry.yarnpkg.com/async-foreach/-/async-foreach-0.1.3.tgz#36121f845c0578172de419a97dbeb1d16ec34542"
391391

392-
async@2.1.2, async@^2.0.1, async@^2.1.2:
392+
async@2.1.2:
393393
version "2.1.2"
394394
resolved "https://registry.yarnpkg.com/async/-/async-2.1.2.tgz#612a4ab45ef42a70cde806bad86ee6db047e8385"
395395
dependencies:
@@ -403,18 +403,12 @@ async@^1.4.0, async@^1.4.2, async@^1.5.2:
403403
version "1.5.2"
404404
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"
405405

406-
async@^2.0.0-rc.5:
406+
async@^2.0.0-rc.5, async@^2.0.1, async@^2.1.2, async@^2.1.4:
407407
version "2.5.0"
408408
resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d"
409409
dependencies:
410410
lodash "^4.14.0"
411411

412-
async@^2.1.4:
413-
version "2.1.5"
414-
resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc"
415-
dependencies:
416-
lodash "^4.14.0"
417-
418412
async@~0.2.6:
419413
version "0.2.10"
420414
resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1"
@@ -790,10 +784,6 @@ caseless@~0.11.0:
790784
version "0.11.0"
791785
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.11.0.tgz#715b96ea9841593cc33067923f5ec60ebda4f7d7"
792786

793-
caseless@~0.12.0:
794-
version "0.12.0"
795-
resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc"
796-
797787
center-align@^0.1.1:
798788
version "0.1.3"
799789
resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
@@ -838,12 +828,6 @@ clap@^1.0.9:
838828
dependencies:
839829
chalk "^1.1.3"
840830

841-
clean-css@4.0.x:
842-
version "4.0.8"
843-
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.0.8.tgz#063dfd593404d3a3d1db494d4b6d0f378b0781b6"
844-
dependencies:
845-
source-map "0.5.x"
846-
847831
clean-css@4.1.x, clean-css@^4.0.10:
848832
version "4.1.7"
849833
resolved "https://registry.yarnpkg.com/clean-css/-/clean-css-4.1.7.tgz#b9aea4f85679889cf3eae8b40349ec4ebdfdd032"
@@ -2335,10 +2319,6 @@ handlebars@^4.0.3:
23352319
optionalDependencies:
23362320
uglify-js "^2.6"
23372321

2338-
har-schema@^1.0.5:
2339-
version "1.0.5"
2340-
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
2341-
23422322
har-validator@~2.0.6:
23432323
version "2.0.6"
23442324
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-2.0.6.tgz#cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d"
@@ -2348,13 +2328,6 @@ har-validator@~2.0.6:
23482328
is-my-json-valid "^2.12.4"
23492329
pinkie-promise "^2.0.0"
23502330

2351-
har-validator@~4.2.1:
2352-
version "4.2.1"
2353-
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a"
2354-
dependencies:
2355-
ajv "^4.9.1"
2356-
har-schema "^1.0.5"
2357-
23582331
has-ansi@^2.0.0:
23592332
version "2.0.0"
23602333
resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
@@ -2449,20 +2422,7 @@ html-entities@^1.2.0:
24492422
version "1.2.0"
24502423
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.0.tgz#41948caf85ce82fed36e4e6a0ed371a6664379e2"
24512424

2452-
html-minifier@^3.2.3:
2453-
version "3.4.1"
2454-
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.4.1.tgz#0bf3c54d7f116d500b78c51fc4246039922dc250"
2455-
dependencies:
2456-
camel-case "3.0.x"
2457-
clean-css "4.0.x"
2458-
commander "2.9.x"
2459-
he "1.1.x"
2460-
ncname "1.0.x"
2461-
param-case "2.1.x"
2462-
relateurl "0.2.x"
2463-
uglify-js "2.8.x"
2464-
2465-
html-minifier@^3.4.2:
2425+
html-minifier@^3.2.3, html-minifier@^3.4.2:
24662426
version "3.5.2"
24672427
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.2.tgz#d73bc3ff448942408818ce609bf3fb0ea7ef4eb7"
24682428
dependencies:
@@ -2867,10 +2827,6 @@ isexe@^1.1.1:
28672827
version "1.1.2"
28682828
resolved "https://registry.yarnpkg.com/isexe/-/isexe-1.1.2.tgz#36f3e22e60750920f5e7241a476a8c6a42275ad0"
28692829

2870-
isexe@^2.0.0:
2871-
version "2.0.0"
2872-
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
2873-
28742830
isobject@^2.0.0, isobject@^2.1.0:
28752831
version "2.1.0"
28762832
resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
@@ -3425,11 +3381,7 @@ lowercase-keys@^1.0.0:
34253381
version "1.0.0"
34263382
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-1.0.0.tgz#4e3366b39e7f5457e35f1324bdf6f88d0bfc7306"
34273383

3428-
lru-cache@2:
3429-
version "2.7.3"
3430-
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.7.3.tgz#6d4524e8b955f95d4f5b58851ce21dd72fb4e952"
3431-
3432-
lru-cache@2.2.x:
3384+
lru-cache@2, lru-cache@2.2.x:
34333385
version "2.2.4"
34343386
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-2.2.4.tgz#6c658619becf14031d0d0b594b16042ce4dc063d"
34353387

@@ -3708,30 +3660,7 @@ node-pre-gyp@^0.6.29:
37083660
tar "~2.2.1"
37093661
tar-pack "~3.3.0"
37103662

3711-
node-sass@^4.3.0:
3712-
version "4.5.0"
3713-
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.5.0.tgz#532e37bad0ce587348c831535dbc98ea4289508b"
3714-
dependencies:
3715-
async-foreach "^0.1.3"
3716-
chalk "^1.1.1"
3717-
cross-spawn "^3.0.0"
3718-
gaze "^1.0.0"
3719-
get-stdin "^4.0.1"
3720-
glob "^7.0.3"
3721-
in-publish "^2.0.0"
3722-
lodash.assign "^4.2.0"
3723-
lodash.clonedeep "^4.3.2"
3724-
lodash.mergewith "^4.6.0"
3725-
meow "^3.7.0"
3726-
mkdirp "^0.5.1"
3727-
nan "^2.3.2"
3728-
node-gyp "^3.3.1"
3729-
npmlog "^4.0.0"
3730-
request "^2.61.0"
3731-
sass-graph "^2.1.1"
3732-
stdout-stream "^1.4.0"
3733-
3734-
node-sass@^4.5.1:
3663+
node-sass@^4.3.0, node-sass@^4.5.1:
37353664
version "4.5.3"
37363665
resolved "https://registry.yarnpkg.com/node-sass/-/node-sass-4.5.3.tgz#d09c9d1179641239d1b97ffc6231fdcec53e1568"
37373666
dependencies:
@@ -4093,10 +4022,6 @@ pbkdf2@^3.0.3:
40934022
dependencies:
40944023
create-hmac "^1.1.2"
40954024

4096-
performance-now@^0.2.0:
4097-
version "0.2.0"
4098-
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
4099-
41004025
pify@^2.0.0:
41014026
version "2.3.0"
41024027
resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c"
@@ -4491,7 +4416,7 @@ qjobs@^1.1.4:
44914416
version "1.1.5"
44924417
resolved "https://registry.yarnpkg.com/qjobs/-/qjobs-1.1.5.tgz#659de9f2cf8dcc27a1481276f205377272382e73"
44934418

4494-
qs@6.4.0, qs@~6.4.0:
4419+
qs@6.4.0:
44954420
version "6.4.0"
44964421
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
44974422

@@ -4589,19 +4514,7 @@ readable-stream@1.0, "readable-stream@>=1.0.33-1 <1.1.0-0", readable-stream@~1.0
45894514
isarray "0.0.1"
45904515
string_decoder "~0.10.x"
45914516

4592-
readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.0:
4593-
version "2.2.3"
4594-
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.3.tgz#9cf49463985df016c8ae8813097a9293a9b33729"
4595-
dependencies:
4596-
buffer-shims "^1.0.0"
4597-
core-util-is "~1.0.0"
4598-
inherits "~2.0.1"
4599-
isarray "~1.0.0"
4600-
process-nextick-args "~1.0.6"
4601-
string_decoder "~0.10.x"
4602-
util-deprecate "~1.0.1"
4603-
4604-
readable-stream@^2.1.5:
4517+
readable-stream@^2.0.0, "readable-stream@^2.0.0 || ^1.1.13", readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.5, readable-stream@^2.1.0, readable-stream@^2.1.5:
46054518
version "2.3.3"
46064519
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c"
46074520
dependencies:
@@ -4764,34 +4677,7 @@ replace-ext@0.0.1:
47644677
version "0.0.1"
47654678
resolved "https://registry.yarnpkg.com/replace-ext/-/replace-ext-0.0.1.tgz#29bbd92078a739f0bcce2b4ee41e837953522924"
47664679

4767-
request@2, request@^2.61.0, request@^2.72.0, request@^2.78.0, request@^2.79.0:
4768-
version "2.81.0"
4769-
resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
4770-
dependencies:
4771-
aws-sign2 "~0.6.0"
4772-
aws4 "^1.2.1"
4773-
caseless "~0.12.0"
4774-
combined-stream "~1.0.5"
4775-
extend "~3.0.0"
4776-
forever-agent "~0.6.1"
4777-
form-data "~2.1.1"
4778-
har-validator "~4.2.1"
4779-
hawk "~3.1.3"
4780-
http-signature "~1.1.0"
4781-
is-typedarray "~1.0.0"
4782-
isstream "~0.1.2"
4783-
json-stringify-safe "~5.0.1"
4784-
mime-types "~2.1.7"
4785-
oauth-sign "~0.8.1"
4786-
performance-now "^0.2.0"
4787-
qs "~6.4.0"
4788-
safe-buffer "^5.0.1"
4789-
stringstream "~0.0.4"
4790-
tough-cookie "~2.3.0"
4791-
tunnel-agent "^0.6.0"
4792-
uuid "^3.0.0"
4793-
4794-
request@2.79.0:
4680+
request@2, request@2.79.0, request@^2.72.0, request@^2.78.0, request@^2.79.0:
47954681
version "2.79.0"
47964682
resolved "https://registry.yarnpkg.com/request/-/request-2.79.0.tgz#4dfe5bf6be8b8cdc37fcf93e04b65577722710de"
47974683
dependencies:
@@ -5573,12 +5459,6 @@ tty-browserify@0.0.0:
55735459
version "0.0.0"
55745460
resolved "https://registry.yarnpkg.com/tty-browserify/-/tty-browserify-0.0.0.tgz#a157ba402da24e9bf957f9aa69d524eed42901a6"
55755461

5576-
tunnel-agent@^0.6.0:
5577-
version "0.6.0"
5578-
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
5579-
dependencies:
5580-
safe-buffer "^5.0.1"
5581-
55825462
tunnel-agent@~0.4.1:
55835463
version "0.4.3"
55845464
resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.4.3.tgz#6373db76909fe570e08d73583365ed828a74eeeb"
@@ -5598,21 +5478,21 @@ type-is@~1.6.14:
55985478
version "2.0.10"
55995479
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.0.10.tgz#ccdd4ed86fd5550a407101a0814012e1b3fac3dd"
56005480

5601-
uglify-js@2.8.x, uglify-js@^2.6, uglify-js@^2.7.5:
5602-
version "2.8.12"
5603-
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.12.tgz#8a50f5d482243650b7108f6080aa3a6afe2a6c55"
5604-
dependencies:
5605-
source-map "~0.5.1"
5606-
uglify-to-browserify "~1.0.0"
5607-
yargs "~3.10.0"
5608-
56095481
uglify-js@3.0.x, uglify-js@^3.0.15:
56105482
version "3.0.25"
56115483
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.0.25.tgz#3dc190b0ee437497e449bc6f785665b06afbe052"
56125484
dependencies:
56135485
commander "~2.9.0"
56145486
source-map "~0.5.1"
56155487

5488+
uglify-js@^2.6, uglify-js@^2.7.5:
5489+
version "2.8.12"
5490+
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.12.tgz#8a50f5d482243650b7108f6080aa3a6afe2a6c55"
5491+
dependencies:
5492+
source-map "~0.5.1"
5493+
uglify-to-browserify "~1.0.0"
5494+
yargs "~3.10.0"
5495+
56165496
uglify-js@~2.3:
56175497
version "2.3.6"
56185498
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.3.6.tgz#fa0984770b428b7a9b2a8058f46355d14fef211a"
@@ -5759,13 +5639,7 @@ uuid@^3.0.0:
57595639
version "3.0.1"
57605640
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1"
57615641

5762-
v8flags@^2.0.11:
5763-
version "2.0.11"
5764-
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.0.11.tgz#bca8f30f0d6d60612cc2c00641e6962d42ae6881"
5765-
dependencies:
5766-
user-home "^1.1.1"
5767-
5768-
v8flags@^2.0.2:
5642+
v8flags@^2.0.11, v8flags@^2.0.2:
57695643
version "2.1.1"
57705644
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4"
57715645
dependencies:
@@ -5973,18 +5847,12 @@ which-module@^1.0.0:
59735847
version "1.0.0"
59745848
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"
59755849

5976-
which@1, which@^1.2.1, which@^1.2.9:
5850+
which@1, which@^1.2.1, which@^1.2.12, which@^1.2.9:
59775851
version "1.2.12"
59785852
resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192"
59795853
dependencies:
59805854
isexe "^1.1.1"
59815855

5982-
which@^1.2.12:
5983-
version "1.2.14"
5984-
resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5"
5985-
dependencies:
5986-
isexe "^2.0.0"
5987-
59885856
wide-align@^1.1.0:
59895857
version "1.1.0"
59905858
resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.0.tgz#40edde802a71fea1f070da3e62dcda2e7add96ad"

0 commit comments

Comments
 (0)