Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(share): render conflict modal in public shares #49924

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(share): render conflict modal in public shares
Handle templates with license comments in `octemplate.js`.

Signed-off-by: Max <max@nextcloud.com>
  • Loading branch information
max-nextcloud committed Dec 19, 2024
commit 13189d799081e8a953cc33ccd8f9ae246893f9dc
11 changes: 10 additions & 1 deletion core/src/jquery/octemplate.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Template = {
},
// From stackoverflow.com/questions/1408289/best-way-to-do-variable-interpolation-in-javascript
_build(o) {
const data = this.elem.attr('type') === 'text/template' ? this.elem.html() : this.elem.get(0).outerHTML
const data = this._getData()
try {
return data.replace(/{([^{}]*)}/g,
function(a, b) {
Expand All @@ -95,6 +95,15 @@ const Template = {
console.error(e, 'data:', data)
}
},
_getData() {
if (this.elem.attr('type') === 'text/template') {
return this.elem.html()
}
// Leave out comments, etc and take the first html element
const htmlElem = $.makeArray(this.elem)
.find(e => e instanceof HTMLElement)
return htmlElem.outerHTML
},
options: {
escapeFunction: escapeHTML,
},
Expand Down
Loading