@saltcorn/markup
Advanced tools
Comparing version 0.7.0-beta.1 to 0.7.0-beta.2
@@ -53,6 +53,7 @@ "use strict"; | ||
const applyTextStyle = (segment, inner) => { | ||
let style = segment.font | ||
const style = segment.font | ||
? { fontFamily: segment.font, ...segment.style } | ||
: segment.style || {}; | ||
let hasStyle = Object.keys(style).length > 0; | ||
const hasStyle = Object.keys(style).length > 0; | ||
const to_bs5 = (s) => (s === "font-italic" ? "fst-italic" : s); | ||
if (segment.textStyle && segment.textStyle.startsWith("h") && segment.inline) | ||
@@ -75,5 +76,5 @@ style.display = "inline-block"; | ||
return segment.block | ||
? div({ class: segment.textStyle || "", style }, inner) | ||
? div({ class: to_bs5(segment.textStyle || ""), style }, inner) | ||
: segment.textStyle || hasStyle | ||
? span({ class: segment.textStyle || "", style }, inner) | ||
? span({ class: to_bs5(segment.textStyle || ""), style }, inner) | ||
: inner; | ||
@@ -80,0 +81,0 @@ } |
@@ -16,6 +16,7 @@ "use strict"; | ||
const applyTextStyle = (segment, inner) => { | ||
let style = segment.font | ||
const style = segment.font | ||
? { fontFamily: segment.font, ...segment.style } | ||
: segment.style || {}; | ||
let hasStyle = Object.keys(style).length > 0; | ||
const hasStyle = Object.keys(style).length > 0; | ||
const to_bs5 = (s) => (s === "font-italic" ? "fst-italic" : s); | ||
if (segment.textStyle && segment.textStyle.startsWith("h") && segment.inline) | ||
@@ -38,5 +39,5 @@ style.display = "inline-block"; | ||
return segment.block | ||
? div({ class: segment.textStyle || "", style }, inner) | ||
? div({ class: to_bs5(segment.textStyle || ""), style }, inner) | ||
: segment.textStyle || hasStyle | ||
? span({ class: segment.textStyle || "", style }, inner) | ||
? span({ class: to_bs5(segment.textStyle || ""), style }, inner) | ||
: inner; | ||
@@ -43,0 +44,0 @@ } |
{ | ||
"name": "@saltcorn/markup", | ||
"version": "0.7.0-beta.1", | ||
"version": "0.7.0-beta.2", | ||
"description": "Markup for Saltcorn, open-source no-code platform", | ||
@@ -35,3 +35,3 @@ "homepage": "https://saltcorn.com", | ||
"devDependencies": { | ||
"@saltcorn/types": "0.7.0-beta.1", | ||
"@saltcorn/types": "0.7.0-beta.2", | ||
"@types/escape-html": "^1.0.1", | ||
@@ -38,0 +38,0 @@ "@types/jest": "^27.0.3", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
204594
2424