prism-remote 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/example.html +2 -2
- package/package.json +1 -1
- package/prism-remote.js +12 -6
package/example.html
CHANGED
package/package.json
CHANGED
package/prism-remote.js
CHANGED
@@ -40,12 +40,18 @@ export class PrismRemote extends HTMLElement {
|
|
40
40
|
|
41
41
|
let code = await this.fetchSrc(rawUrl);
|
42
42
|
let codeLines = code.split("\n");
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
let start = 1;
|
44
|
+
if (this.hasAttribute("start")) {
|
45
|
+
start = this.getAttribute("start");
|
46
|
+
srcUrl = `${srcUrl}#L${start}`;
|
47
|
+
}
|
48
|
+
let end = codeLines.length + 1;
|
49
|
+
if (this.hasAttribute("end")) {
|
50
|
+
end = this.getAttribute("end");
|
51
|
+
if (this.hasAttribute("start")) {
|
52
|
+
srcUrl = `${srcUrl}-L${end}`;
|
53
|
+
}
|
54
|
+
}
|
49
55
|
codeLines = codeLines.splice(start - 1, end - start + 1);
|
50
56
|
code = codeLines.join("\n");
|
51
57
|
|