Don't replace multiple spaces
It fucks up indentation :((
This commit is contained in:
@@ -209,17 +209,19 @@ const Index = () => {
|
|||||||
|
|
||||||
// Clean content function
|
// Clean content function
|
||||||
const cleanContent = (content: string) => {
|
const cleanContent = (content: string) => {
|
||||||
const lines = content.split('\n');
|
return content.trim();
|
||||||
const trimmedLines: string[] = [];
|
// const lines = content.split('\n');
|
||||||
|
// const trimmedLines: string[] = [];
|
||||||
|
|
||||||
for (const line of lines) {
|
// for (const line of lines) {
|
||||||
const trimmedContent = line.trim().replace(/\s{2,}/g, ' ');
|
// // const trimmedContent = line.trim().replace(/\s{2,}/g, ' ');
|
||||||
if (trimmedContent.length > 0) {
|
// const trimmedContent = line.trim();
|
||||||
trimmedLines.push(trimmedContent);
|
// if (trimmedContent.length > 0) {
|
||||||
}
|
// trimmedLines.push(trimmedContent);
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
return trimmedLines.join('\n');
|
// return trimmedLines.join('\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
// Flexible ISO8601 date parsing (supports YYYY, YYYY-MM, YYYY-MM-DD, full ISO)
|
// Flexible ISO8601 date parsing (supports YYYY, YYYY-MM, YYYY-MM-DD, full ISO)
|
||||||
|
Reference in New Issue
Block a user