You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: move some functions and module-level state into classes as private methods and properties to start to encapsulate Docsify
Also some small tweaks:
- move initGlobalAPI out of Docsify.js to start to encapsulate Docsify
- move ajax to utils folder
- fix some type definitions and improve content in some JSDoc comments
- use concise class field syntax
- consolidate duplicate docsify-ignore comment removal code
This handles a task in [Simplify and modernize Docsify](#2104), as well as works towards [Encapsulating Docsify](#2135).
Copy file name to clipboardexpand all lines: src/core/render/utils.js
+5-5
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@
16
16
*
17
17
* @param {string} str The string to parse.
18
18
*
19
-
* @return {object}The original string and parsed object, { str, config }.
19
+
* @return {{str: string, config: object}} The original string formatted, and parsed object, { str, config }.
20
20
*/
21
21
exportfunctiongetAndRemoveConfig(str=''){
22
22
constconfig={};
@@ -43,19 +43,19 @@ export function getAndRemoveConfig(str = '') {
43
43
* Remove the <a> tag from sidebar when the header with link, details see issue 1069
44
44
* @param {string} str The string to deal with.
45
45
*
46
-
* @return {string} str The string after delete the <a> element.
46
+
* @return {string} The string after delete the <a> element.
47
47
*/
48
48
exportfunctionremoveAtag(str=''){
49
49
returnstr.replace(/(<\/?a.*?>)/gi,'');
50
50
}
51
51
52
52
/**
53
53
* Remove the docsifyIgnore configs and return the str
54
-
* @param {string} str The string to deal with.
54
+
* @param {string} content The string to deal with.
55
55
*
56
-
* @return {string} str The string after delete the docsifyIgnore configs.
56
+
* @return {{content: string, ignoreAllSubs: boolean, ignoreSubHeading: boolean}} The string after delete the docsifyIgnore configs, and whether to ignore some or all.
0 commit comments