Skip to content

Commit

Permalink
Merge pull request #412 from openstad/bugfix/translation-trims-spaces…
Browse files Browse the repository at this point in the history
…-around-a-tags

Translating to another language, respects whitespace
  • Loading branch information
LorenzoJokhan committed Jul 21, 2023
2 parents 8abf80e + 4f96711 commit a295d14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cms/lib/modules/openstad-global/lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = (self, options) => {
content,
sourceLanguageCode,
destinationLanguage,
{tagHandling:'html'}
).then(response => {
collection.findOneAndUpdate(
{"_id": cacheKey},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ handleNode = function (node, toBeTranslated) {

if (shouldTranslate) {
var textContent = childNodes[i].textContent;
textContent = textContent.replace(/^[\s\r\n]+/, '').replace(/[\s\r\n]+$/, '');

if (textContent) {
toBeTranslated.push({
node: childNodes[i],
Expand Down

2 comments on commit a295d14

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Published new image: openstad/frontend:development-a295d14

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Published new image: openstad/frontend:feature-extend-arguments-widget-cp-a295d14

Please sign in to comment.