fix embed svg (additional classes)
This commit is contained in:
@@ -113,7 +113,7 @@ exports.groupTeamsnapItems = (items, types = [], params = {}) => {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.embeddedSvgFromPath = (svg_path, additional_classes = "") => {
|
exports.embeddedSvgFromPath = (svg_path, additional_classes, options) => {
|
||||||
const iconStaticPaths = {
|
const iconStaticPaths = {
|
||||||
"/teamsnap-ui/assets":path.join(__dirname, "/../../node_modules/@teamsnap/teamsnap-ui/src/assets"),
|
"/teamsnap-ui/assets":path.join(__dirname, "/../../node_modules/@teamsnap/teamsnap-ui/src/assets"),
|
||||||
"/bootstrap-icons":path.join(__dirname, "/../../node_modules/bootstrap-icons/icons"),
|
"/bootstrap-icons":path.join(__dirname, "/../../node_modules/bootstrap-icons/icons"),
|
||||||
@@ -126,6 +126,8 @@ exports.embeddedSvgFromPath = (svg_path, additional_classes = "") => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!options) {options=additional_classes; additional_classes=''}
|
||||||
|
|
||||||
const svg = fs.readFileSync(`${svg_path}`, 'utf8');
|
const svg = fs.readFileSync(`${svg_path}`, 'utf8');
|
||||||
|
|
||||||
svgRegExWithClass = new RegExp(/<svg(.*)class="(.*?)"(.*)>/)
|
svgRegExWithClass = new RegExp(/<svg(.*)class="(.*?)"(.*)>/)
|
||||||
|
|||||||
Reference in New Issue
Block a user