Skip to content

Commit

Permalink
feat: add baseurl as option (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo committed Apr 13, 2022
1 parent f2fd640 commit a937be4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ sap.ui.define(["sap/ui/core/Control", "./marked/marked.min"], (Control /*, marke
metadata: {
properties: {
content: { type: "string", defaultValue: "", bindable: "bindable" },
fromFile: { type: "string", defaultValue: "", bindable: "bindable" }
fromFile: { type: "string", defaultValue: "", bindable: "bindable" },
baseURL: { type: "string", defaultValue: "", bindable: "bindable" }
}
},
init() {
Expand All @@ -18,6 +19,9 @@ sap.ui.define(["sap/ui/core/Control", "./marked/marked.min"], (Control /*, marke
* @param {sap.ui.core.Control} oControl this control, ui5-cc-md.Markdown
*/
render(oRM, oControl) {
marked.setOptions({
baseUrl: oControl.getBaseURL()
})
console.debug(`[${oControl.getMetadata().getName()}] > rendering`)
oRM.openStart("div", oControl)
oRM.openEnd()
Expand Down

0 comments on commit a937be4

Please sign in to comment.