11// @TODO include things from a new module that we have.
22// we need to pass all constants somewhere, but not to the replaceWrapper
3+ import { replaceMarkdown } from '../replace-markdown/replace-md' ;
34
45class Replace {
56 constructor ( ) {
@@ -9,113 +10,51 @@ class Replace {
910 // Replacer.replaceMDBindedPreviewText = replaceMarkdownPreviewText.bind(state);
1011 // this.replaceMDBindedPreviewText = () => {};
1112
12- this . previewText = function ( ) {
13- this . replaceMDBinded ( 'previewText' ) ;
14- } ;
15-
16- // this.comments = () => {
17- // // HEEEEEEYY
18- // this.replaceMDBinded('');
19- // };
20-
21- this . strong = ( ) => {
22- this . replaceMDBinded ( 'strong' ) ;
23- } ;
24-
25- this . em = ( ) => {
26- this . replaceMDBinded ( 'italic' ) ;
27- } ;
13+ this . previewText = ( ) => this . replaceMDBinded ( 'previewText' ) ;
2814
15+ this . strong = ( ) => this . replaceMDBinded ( 'strong' ) ;
16+ this . em = ( ) => this . replaceMDBinded ( 'italic' ) ;
2917 // TODO finish this case
30- this . italicAsterix = ( ) => {
31- this . replaceMDBinded ( 'italic_asterix' ) ;
32- } ;
33-
18+ this . italicAsterix = ( ) => this . replaceMDBinded ( 'italic_asterix' ) ;
3419 // TODO working not ideally, because we have headings & subtitles,
3520 // so it's confusing a little bit
36- this . header = ( ) => {
37- this . replaceMDBinded ( 'header' ) ;
38- } ;
39-
40- this . subtitle = ( ) => {
41- this . replaceMDBinded ( 'header' ) ;
42- } ;
43- this . title = ( ) => {
44- this . replaceMDBinded ( 'header' ) ;
45- } ;
46-
47- this . image = ( ) => {
48- this . replaceMDBinded ( 'image' ) ;
49- } ;
50-
51- this . link = ( ) => {
52- this . replaceMDBinded ( 'link' ) ;
53- } ;
54-
55- this . del = ( ) => {
56- this . replaceMDBinded ( 'del' ) ;
57- } ;
58-
59- this . q = ( ) => {
60- this . replaceMDBinded ( 'q' ) ;
61- } ;
62-
63- this . code = ( ) => {
64- this . replaceMDBinded ( 'code' ) ;
65- } ;
66-
67- this . ul = ( ) => {
68- this . replaceMDBinded ( 'ulList' ) ;
69- } ;
70-
71- this . ol = ( ) => {
72- this . replaceMDBinded ( 'olList' ) ;
73- } ;
74-
75- this . blockquote = ( ) => {
76- this . replaceMDBinded ( 'blockquote' ) ;
77- } ;
78-
79- this . hr = ( ) => {
80- this . replaceMDBinded ( 'hr' ) ;
81- } ;
82-
83- this . paragraph = ( ) => {
84- this . replaceMDBinded ( 'paragraph' ) ;
85- } ;
86- //---------------------
87- // TODO hiding for now, let's fix it after our release
88- // this.emptyUl = () => {
89- // this.replaceMDBinded('REGEXP_EMPTY_UL');
90- // };
91-
92- // this.emptyOl = () => {
93- // this.replaceMDBinded('REGEXP_EMPTY_OL');
94- // };
21+ this . header = ( ) => this . replaceMDBinded ( 'header' ) ;
22+ this . subtitle = ( ) => this . replaceMDBinded ( 'header' ) ;
23+ this . title = ( ) => this . replaceMDBinded ( 'header' ) ;
24+ this . image = ( ) => this . replaceMDBinded ( 'image' ) ;
25+ this . link = ( ) => this . replaceMDBinded ( 'link' ) ;
26+ this . del = ( ) => this . replaceMDBinded ( 'del' ) ;
27+ this . q = ( ) => this . replaceMDBinded ( 'q' ) ;
28+ this . code = ( ) => this . replaceMDBinded ( 'code' ) ;
29+ this . ul = ( ) => this . replaceMDBinded ( 'ulList' ) ;
30+ this . ol = ( ) => this . replaceMDBinded ( 'olList' ) ;
31+ this . blockquote = ( ) => this . replaceMDBinded ( 'blockquote' ) ;
32+ this . hr = ( ) => this . replaceMDBinded ( 'hr' ) ;
33+ this . paragraph = ( ) => this . replaceMDBinded ( 'paragraph' ) ;
34+ this . br = ( ) => this . replaceMDBinded ( 'br' ) ;
35+ this . sponsorship = ( ) => this . replaceMDBinded ( 'sponsorship' ) ;
36+ // here we have a different name
37+ this . memes = ( ) => this . replaceMDBinded ( 'memes' ) ;
38+ this . separator = ( ) => this . replaceMDBinded ( 'separator' ) ;
9539
96- // this line is generating an error
97- // this.replaceMDBinded(this._constants.REGEXP_EMPTY_BLOCKQUOTE, newLine);
98- // this.emptyBlockquote = () => {
40+ // TODO hiding for now, let's fix it after our release
41+ // this.emptyUl = () => this.replaceMDBinded('REGEXP_EMPTY_UL');
42+ // this.emptyOl = () => this.replaceMDBinded('REGEXP_EMPTY_OL');
43+ // this.comments = () => this.replaceMDBinded('');
44+ // this.emptyBlockquote = () =>
9945 // this.replaceMDBinded('REGEXP_EMPTY_BLOCKQUOTE');
100- // };
101- //---------------------
102-
103- this . br = function ( ) {
104- this . replaceMDBinded ( 'br' ) ;
105- } ;
46+ }
10647
107- this . sponsorship = function ( ) {
108- this . replaceMDBinded ( 'sponsorship' ) ;
109- } ;
48+ configure ( state ) {
49+ this . replaceMDBinded = replaceMarkdown . bind ( state ) ;
11050
111- // here we have a different name
112- this . memes = function ( ) {
113- this . replaceMDBinded ( 'memes' ) ;
114- } ;
51+ // TODO crashed when here in FULL mode, needs to be fixed
52+ this . previewText ( ) ;
11553
116- this . separator = function ( ) {
117- this . replaceMDBinded ( 'separator' ) ;
118- } ;
54+ // Replacer.comments();
55+ this . typography ( ) ;
56+ this . template ( ) ;
57+ this . miscellaneous ( ) ;
11958 }
12059
12160 template ( ) {
@@ -142,10 +81,10 @@ class Replace {
14281
14382 typography ( ) {
14483 this . strong ( ) ;
145- //---------------
84+
14685 this . em ( ) ;
14786 this . italicAsterix ( ) ;
148- //---------------
87+
14988 this . subtitle ( ) ;
15089 this . title ( ) ;
15190 // this.header();
@@ -155,13 +94,13 @@ class Replace {
15594 this . del ( ) ;
15695 this . q ( ) ;
15796 this . code ( ) ;
158- //-----
97+
15998 this . ul ( ) ;
16099 this . ol ( ) ;
161- //-----
100+
162101 this . blockquote ( ) ;
163102 this . hr ( ) ;
164- //-----
103+
165104 this . paragraph ( ) ;
166105
167106 // TODO fix this
0 commit comments