mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #6100 from scinote-eln/hotfix/1.28.0.2
Hotfix/1.28.0.2
This commit is contained in:
commit
ffb8c7c455
4 changed files with 16 additions and 10 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
1.28.0.1
|
||||
1.28.0.2
|
||||
|
|
|
@ -4,8 +4,8 @@ require 'sanitize'
|
|||
require 'cgi'
|
||||
|
||||
module InputSanitizeHelper
|
||||
def sanitize_input(html, _tags = [], _attributes = [])
|
||||
Sanitize.fragment(html, Constants::INPUT_SANITIZE_CONFIG).html_safe
|
||||
def sanitize_input(html, _tags = [], _attributes = [], sanitizer_config: Constants::INPUT_SANITIZE_CONFIG)
|
||||
Sanitize.fragment(html, sanitizer_config).html_safe
|
||||
end
|
||||
|
||||
def escape_input(text)
|
||||
|
@ -33,7 +33,12 @@ module InputSanitizeHelper
|
|||
format_opt = wrapper_tag.merge(sanitize: false)
|
||||
base64_encoded_imgs = options.fetch(:base64_encoded_imgs, false)
|
||||
text = simple_format(text, {}, format_opt) if simple_f
|
||||
text = sanitize_input(text, tags)
|
||||
|
||||
# allow base64 images when sanitizing if base64_encoded_imgs is true
|
||||
sanitizer_config = Constants::INPUT_SANITIZE_CONFIG.deep_dup
|
||||
sanitizer_config[:protocols]['img']['src'] << 'data' if options.fetch(:base64_encoded_imgs, false)
|
||||
text = sanitize_input(text, tags, sanitizer_config: sanitizer_config)
|
||||
|
||||
if text =~ SmartAnnotations::TagToHtml::USER_REGEX || text =~ SmartAnnotations::TagToHtml::REGEX
|
||||
text = smart_annotation_parser(text, team, base64_encoded_imgs, preview_repository)
|
||||
end
|
||||
|
|
11
app/javascript/packs/tiny_mce.js
vendored
11
app/javascript/packs/tiny_mce.js
vendored
|
@ -195,11 +195,12 @@ window.TinyMCE = (() => {
|
|||
document.location.hash = `${textAreaObject.data('objectType')}_${textAreaObject.data('objectId')}`;
|
||||
}
|
||||
|
||||
if ($('.navbar-secondary').length) {
|
||||
editorToolbaroffset = $('.navbar-secondary').position().top + $('.navbar-secondary').height();
|
||||
} else if ($('#main-nav').length) {
|
||||
editorToolbaroffset = $('#main-nav').height();
|
||||
}
|
||||
let topMenuHeight = $('.sci--navigation--top-menu-container') ? $('.sci--navigation--top-menu-container').height() : 0;
|
||||
let breadcrumbsHeight = $('.sci--layout-navigation-breadcrumbs') ? $('.sci--layout-navigation-breadcrumbs').height() : 0;
|
||||
let secondaryNavHeight = $('.content-header.sticky-header') ? $('.content-header.sticky-header').height() : 0;
|
||||
|
||||
editorToolbaroffset = topMenuHeight + breadcrumbsHeight + secondaryNavHeight;
|
||||
|
||||
|
||||
return tinyMCE.init({
|
||||
cache_suffix: '?v=6.5.1-19', // This suffix should be changed any time library is updated
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="report-element-children">
|
||||
<%= render partial: 'reports/elements/my_module_protocol_element', locals: { protocol: my_module.protocol } %>
|
||||
<%= render partial: 'reports/elements/my_module_protocol_element', locals: { protocol: my_module.protocol, export_all: export_all } %>
|
||||
|
||||
<% filter_steps_for_report(my_module.protocol.steps, @settings).order(:position).each do |step| %>
|
||||
<%= render partial: 'reports/elements/my_module_step_element', locals: { step: step, export_all: export_all } %>
|
||||
|
|
Loading…
Reference in a new issue