mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-17 12:41:20 +08:00
feat: add find.md
& sed.md
cheatsheet.
This commit is contained in:
@ -82,8 +82,8 @@ export function getTocsTree(arr = [], result = []) {
|
||||
}
|
||||
|
||||
export function create(str = '', options = {}) {
|
||||
let title = str.match(/[^===]+(?=[===])/g);
|
||||
let description = str.match(/\n==={1,}\n+([\s\S]*?)\n/g);
|
||||
let title = str.match(/[^===]+(?=[===])/g) || [];
|
||||
let description = str.match(/\n==={1,}\n+([\s\S]*?)\n/g) || [];
|
||||
title = title[0] || '';
|
||||
description = (description[0] || '').replace(/^\n[=\n]+/, '').replace(/\[([\s\S]*?)?\]\(([\s\S]*?)?\)/g, '$1').replace(/\n/, '');
|
||||
const subTitle = options.filename && !options.isHome ? `${options.filename} cheatsheet & `: ''
|
||||
|
Reference in New Issue
Block a user