Skip to content

Commit

Permalink
refactor(preset): support to use single-quote for code tag attr
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Apr 15, 2020
1 parent 0f33aa1 commit fe32015
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/preset-dumi/src/transformer/remark/externalDemo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const fileWatchers: { [key: string]: fs.FSWatcher[] } = {};
export function HTMLAttrParser(str: string): { [key: string]: any } {
const attrs = {};

(str || '').replace(/([^=\s]+)(="([^"]+)")?/g, (_, name, content, value) => {
attrs[name] = content ? value : true;
(str || '').replace(/([^=\s]+)(="([^"]+)"|='([^']+)')?/g, (_, name, content, value1, value2) => {
attrs[name] = content ? value1 || value2 : true;

return _;
});
Expand Down

0 comments on commit fe32015

Please sign in to comment.