File tree 5 files changed +143
-130
lines changed
5 files changed +143
-130
lines changed Original file line number Diff line number Diff line change 21
21
## Miscellaneous
22
22
23
23
- Work around pandoc strict checking of ` number-offset ` type. ([ #3126 ] ( https://github.com/quarto-dev/quarto-cli/issues/3126 ) )
24
+ - Warn instead of crash on bad URI ([ #3220 ] ( https://github.com/quarto-dev/quarto-cli/issues/3220 ) )
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { pandocAutoIdentifier } from "./pandoc/pandoc-id.ts";
11
11
import { isFileRef } from "./http.ts" ;
12
12
import { cssFileRefs } from "./css.ts" ;
13
13
import { HtmlPostProcessResult } from "../command/render/types.ts" ;
14
+ import { warning } from "log/mod.ts" ;
14
15
15
16
export function asHtmlId ( text : string ) {
16
17
return pandocAutoIdentifier ( text , false ) ;
@@ -19,7 +20,18 @@ export function asHtmlId(text: string) {
19
20
export function getDecodedAttribute ( element : Element , attrib : string ) {
20
21
const value = element . getAttribute ( attrib ) ;
21
22
if ( value ) {
22
- return decodeURI ( value ) ;
23
+ try {
24
+ return decodeURI ( value ) ;
25
+ } catch ( e ) {
26
+ if ( e instanceof URIError ) {
27
+ warning (
28
+ `Invalid URI '${ value } ' in attribute '${ attrib } ' of element '${ element . tagName } '` ,
29
+ ) ;
30
+ return value ;
31
+ } else {
32
+ throw e ;
33
+ }
34
+ }
23
35
} else {
24
36
return value ;
25
37
}
Original file line number Diff line number Diff line change @@ -16437,48 +16437,6 @@ var require_yaml_intelligence_resources = __commonJS({
16437
16437
description: "The alt text for preview image on this page."
16438
16438
}
16439
16439
],
16440
- "schema/extension.yml": [
16441
- {
16442
- name: "title",
16443
- description: "Extension title.",
16444
- schema: "string"
16445
- },
16446
- {
16447
- name: "author",
16448
- description: "Extension author.",
16449
- schema: "string"
16450
- },
16451
- {
16452
- name: "version",
16453
- description: "Extension version.",
16454
- schema: {
16455
- ref: "semver"
16456
- }
16457
- },
16458
- {
16459
- name: "quarto-required",
16460
- description: "Quarto version range. See https://docs.npmjs.com/cli/v6/using-npm/semver for syntax details.",
16461
- schema: "string"
16462
- },
16463
- {
16464
- name: "contributes",
16465
- schema: {
16466
- object: {
16467
- properties: {
16468
- shortcodes: {
16469
- arrayOf: "path"
16470
- },
16471
- filters: {
16472
- arrayOf: "path"
16473
- },
16474
- formats: {
16475
- schema: "object"
16476
- }
16477
- }
16478
- }
16479
- }
16480
- }
16481
- ],
16482
16440
"schema/format-aliases.yml": {
16483
16441
aliases: {
16484
16442
"epub-all": [
@@ -20139,7 +20097,49 @@ var require_yaml_intelligence_resources = __commonJS({
20139
20097
]
20140
20098
},
20141
20099
$id: "handlers/mermaid"
20142
- }
20100
+ },
20101
+ "schema/extension.yml": [
20102
+ {
20103
+ name: "title",
20104
+ description: "Extension title.",
20105
+ schema: "string"
20106
+ },
20107
+ {
20108
+ name: "author",
20109
+ description: "Extension author.",
20110
+ schema: "string"
20111
+ },
20112
+ {
20113
+ name: "version",
20114
+ description: "Extension version.",
20115
+ schema: {
20116
+ ref: "semver"
20117
+ }
20118
+ },
20119
+ {
20120
+ name: "quarto-required",
20121
+ description: "Quarto version range. See https://docs.npmjs.com/cli/v6/using-npm/semver for syntax details.",
20122
+ schema: "string"
20123
+ },
20124
+ {
20125
+ name: "contributes",
20126
+ schema: {
20127
+ object: {
20128
+ properties: {
20129
+ shortcodes: {
20130
+ arrayOf: "path"
20131
+ },
20132
+ filters: {
20133
+ arrayOf: "path"
20134
+ },
20135
+ formats: {
20136
+ schema: "object"
20137
+ }
20138
+ }
20139
+ }
20140
+ }
20141
+ }
20142
+ ]
20143
20143
};
20144
20144
}
20145
20145
});
Original file line number Diff line number Diff line change 9413
9413
"description": "The alt text for preview image on this page."
9414
9414
}
9415
9415
],
9416
- "schema/extension.yml": [
9417
- {
9418
- "name": "title",
9419
- "description": "Extension title.",
9420
- "schema": "string"
9421
- },
9422
- {
9423
- "name": "author",
9424
- "description": "Extension author.",
9425
- "schema": "string"
9426
- },
9427
- {
9428
- "name": "version",
9429
- "description": "Extension version.",
9430
- "schema": {
9431
- "ref": "semver"
9432
- }
9433
- },
9434
- {
9435
- "name": "quarto-required",
9436
- "description": "Quarto version range. See https://docs.npmjs.com/cli/v6/using-npm/semver for syntax details.",
9437
- "schema": "string"
9438
- },
9439
- {
9440
- "name": "contributes",
9441
- "schema": {
9442
- "object": {
9443
- "properties": {
9444
- "shortcodes": {
9445
- "arrayOf": "path"
9446
- },
9447
- "filters": {
9448
- "arrayOf": "path"
9449
- },
9450
- "formats": {
9451
- "schema": "object"
9452
- }
9453
- }
9454
- }
9455
- }
9456
- }
9457
- ],
9458
9416
"schema/format-aliases.yml": {
9459
9417
"aliases": {
9460
9418
"epub-all": [
13115
13073
]
13116
13074
},
13117
13075
"$id": "handlers/mermaid"
13118
- }
13076
+ },
13077
+ "schema/extension.yml": [
13078
+ {
13079
+ "name": "title",
13080
+ "description": "Extension title.",
13081
+ "schema": "string"
13082
+ },
13083
+ {
13084
+ "name": "author",
13085
+ "description": "Extension author.",
13086
+ "schema": "string"
13087
+ },
13088
+ {
13089
+ "name": "version",
13090
+ "description": "Extension version.",
13091
+ "schema": {
13092
+ "ref": "semver"
13093
+ }
13094
+ },
13095
+ {
13096
+ "name": "quarto-required",
13097
+ "description": "Quarto version range. See https://docs.npmjs.com/cli/v6/using-npm/semver for syntax details.",
13098
+ "schema": "string"
13099
+ },
13100
+ {
13101
+ "name": "contributes",
13102
+ "schema": {
13103
+ "object": {
13104
+ "properties": {
13105
+ "shortcodes": {
13106
+ "arrayOf": "path"
13107
+ },
13108
+ "filters": {
13109
+ "arrayOf": "path"
13110
+ },
13111
+ "formats": {
13112
+ "schema": "object"
13113
+ }
13114
+ }
13115
+ }
13116
+ }
13117
+ }
13118
+ ]
13119
13119
}
You can’t perform that action at this time.
0 commit comments