trim md
This commit is contained in:
parent
e68abd92a1
commit
f5d83163eb
|
@ -52,7 +52,7 @@ const articles = [
|
||||||
function extractTitleAndSubtitle(markdownContent) {
|
function extractTitleAndSubtitle(markdownContent) {
|
||||||
const lines = markdownContent.split('\n');
|
const lines = markdownContent.split('\n');
|
||||||
const title = lines[0] ? lines[0].replace(/^#+\s*/, '').trim() : 'Untitled';
|
const title = lines[0] ? lines[0].replace(/^#+\s*/, '').trim() : 'Untitled';
|
||||||
const subtitle = lines[3] ? lines[3].trim() : '';
|
const subtitle = lines[3] ? lines[3].replace(/^#+\s*/, '').trim() : '';
|
||||||
return { title, subtitle };
|
return { title, subtitle };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
# Electron
|
# Electron
|
||||||
###### 21th December 2023 - Zoey
|
###### 21th December 2023 - Zoey
|
||||||
<br>
|
<br>
|
||||||
### Electron is awful and here's why.
|
### Electron is awful and here's why.
|
||||||
|
<br>
|
||||||
|
Lorem ipsum motherfuckerssss
|
|
@ -1,4 +1,6 @@
|
||||||
# Wayland
|
# Wayland
|
||||||
######22th December 2023
|
######22th December 2023 - Zoey
|
||||||
<br>
|
<br>
|
||||||
### Insane defaults.
|
### Insane defaults.
|
||||||
|
<br>
|
||||||
|
Lorem ipsum motherfuckerssss
|
Loading…
Reference in a new issue