Skip to content

Commit

Permalink
Merge pull request #16 from opf/update-title-regex
Browse files Browse the repository at this point in the history
update title match regex
  • Loading branch information
PrajwolAmatya authored Jan 13, 2025
2 parents 2e91fe7 + b3f2923 commit 7d04163
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion plugin/awesoMD/awesoMD.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion plugin/awesoMD/awesoMD.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions plugin/awesoMD/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -669,13 +669,13 @@ const plugin = () => {
*/
renderTemplate: function (content, options) {
try {
const titleRegex = /^#+\s*(.*?)\s*$/m
const titleRegex = /^#+\r*(.*?)\r*$/m
const matches = content.match(titleRegex)
let title
if (matches) {
title = matches[1].trim()
}
const slideContent = content.replace(titleRegex, '')
const slideContent = content.replace(titleRegex, '').trim()

options = this.getSlidifyOptions(options)
const url = new URL(import.meta.url)
Expand Down

0 comments on commit 7d04163

Please sign in to comment.