A recent personal blog project encountered this problem. Extract the first part of the article you wrote with markdown as a brief introduction, and use the following regular expression to extract plain text (str.replace (reg, "")
).reg = /[\-sharp\`{3}\*]/g;
but if you think about it carefully, won"t you lose the innocent multiplication sign in the text? Then I thought about it and wrote a
.let reg = /\-sharp|\`{3}|\*|(\*\s)/g;
and then added a * * to the test text. Unexpectedly, it was dropped. It may be that orz
I learned here is not good. Ask for the boss"s advice