Skip to content

Commit

Permalink
fix urls plugin regex
Browse files Browse the repository at this point in the history
  • Loading branch information
pettinarip committed Feb 24, 2022
1 parent 094952d commit caf0bbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/gatsby-remark-image-urls/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ const isRelativeUrl = require("is-relative-url")
*/
module.exports = ({ markdownNode, markdownAST }) => {
const fileAbsoluteDir = path.dirname(markdownNode.fileAbsolutePath)
const sourceAbsoluteDir = fileAbsoluteDir.replace(/translations\/\w{2}\//, "")
const sourceAbsoluteDir = fileAbsoluteDir.replace(
/translations\/\w{2}(-\w{2})?\//,
""
)
const relativePath = path.relative(fileAbsoluteDir, sourceAbsoluteDir)

// if it is not a translated file, skip it
Expand Down

0 comments on commit caf0bbe

Please sign in to comment.