aprog 1.7.0 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/aprog.js +9 -30
package/package.json
CHANGED
package/src/aprog.js
CHANGED
|
@@ -1349,36 +1349,15 @@ export const attachCustomTitle = (element, text) => {
|
|
|
1349
1349
|
};
|
|
1350
1350
|
|
|
1351
1351
|
export const parseCustomMarkup = (text) => {
|
|
1352
|
-
const style = `
|
|
1353
|
-
<style>
|
|
1354
|
-
*.gemini {
|
|
1355
|
-
font-family: "Times New Roman", serif;
|
|
1356
|
-
font-weight: 400;
|
|
1357
|
-
}
|
|
1358
|
-
strong.gemini {
|
|
1359
|
-
font-weight: 700;
|
|
1360
|
-
}
|
|
1361
|
-
code.gemini {
|
|
1362
|
-
font-family: Monospaced, serif;
|
|
1363
|
-
font-style: italic;
|
|
1364
|
-
font-weight: 100;
|
|
1365
|
-
letter-spacing: 2px;
|
|
1366
|
-
}
|
|
1367
|
-
pre.gemini {
|
|
1368
|
-
width: max-content;
|
|
1369
|
-
padding: 2px 8px;
|
|
1370
|
-
color: #333333;
|
|
1371
|
-
background-color: #fdfdfd;
|
|
1372
|
-
border: 0.03125rem solid #dddddd;
|
|
1373
|
-
border-radius: 4px;
|
|
1374
|
-
}
|
|
1375
|
-
</style>
|
|
1376
|
-
`;
|
|
1377
1352
|
text = text.replace(/```([\s\S]*?)```/g, (match, p1) => {
|
|
1378
|
-
return `<pre
|
|
1353
|
+
return `<pre style="gemini"><code style="font-family: Monospaced, serif; font-style: italic; font-weight: 100; letter-spacing: 2px;">${p1.trim()}</code></pre>`;
|
|
1379
1354
|
});
|
|
1380
|
-
|
|
1381
|
-
text = text.replace(
|
|
1382
|
-
|
|
1383
|
-
|
|
1355
|
+
|
|
1356
|
+
text = text.replace(/\*\*(.*?)\*\*/g, '<strong style="font-weight: 700;">$1</strong>');
|
|
1357
|
+
|
|
1358
|
+
text = text.replace(/`([^`]+?)`/g, '<code style="font-family: Monospaced, serif; font-style: italic; font-weight: 100; letter-spacing: 2px;">$1</code>');
|
|
1359
|
+
|
|
1360
|
+
text = text.replace(/^\* (.+)$/gm, '<li style="font-family: Times New Roman, serif; font-weight: 400;">$1</li>');
|
|
1361
|
+
|
|
1362
|
+
return `<div style="font-family: Times New Roman, serif; font-weight: 400;">${text}</div>`;
|
|
1384
1363
|
}
|