Skip to content

Commit 5ef6f57

Browse files
committed
Merge branch 'release' into alpha
2 parents 8684710 + 7dbc42d commit 5ef6f57

File tree

6 files changed

+40
-7
lines changed

6 files changed

+40
-7
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## [6.27.2](https://github.com/Automattic/newspack-plugin/compare/v6.27.1...v6.27.2) (2025-12-16)
2+
3+
4+
### Bug Fixes
5+
6+
* **indesign-exporter:** caption and credit character encoding ([#4364](https://github.com/Automattic/newspack-plugin/issues/4364)) ([5868d27](https://github.com/Automattic/newspack-plugin/commit/5868d2789a2726f808674928c853ce9b2461711f))
7+
18
## [6.27.1](https://github.com/Automattic/newspack-plugin/compare/v6.27.0...v6.27.1) (2025-12-08)
29

310

includes/optional-modules/indesign-export/class-indesign-converter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,10 +468,10 @@ private function process_post_images( $post ) {
468468

469469
$tag_content .= "\r\n";
470470
if ( $caption ) {
471-
$tag_content .= '<pstyle:PhotoCaption>' . $caption . "\r\n";
471+
$tag_content .= '<pstyle:PhotoCaption>' . $this->get_transformed_text( $caption ) . "\r\n";
472472
}
473473
if ( $credit ) {
474-
$tag_content .= '<pstyle:PhotoCredit>' . $credit . "\r\n";
474+
$tag_content .= '<pstyle:PhotoCredit>' . $this->get_transformed_text( $credit ) . "\r\n";
475475
}
476476
}
477477

newspack.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Newspack
44
* Description: An advanced open-source publishing and revenue-generating platform for news organizations.
5-
* Version: 6.28.0-alpha.1
5+
* Version: 6.27.2
66
* Author: Automattic
77
* Author URI: https://newspack.com/
88
* License: GPL2
@@ -14,7 +14,7 @@
1414

1515
defined( 'ABSPATH' ) || exit;
1616

17-
define( 'NEWSPACK_PLUGIN_VERSION', '6.28.0-alpha.1' );
17+
define( 'NEWSPACK_PLUGIN_VERSION', '6.27.2' );
1818

1919
// Define NEWSPACK_PLUGIN_FILE.
2020
if ( ! defined( 'NEWSPACK_PLUGIN_FILE' ) ) {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "newspack",
3-
"version": "6.27.1",
3+
"version": "6.27.2",
44
"description": "The Newspack plugin. https://newspack.com",
55
"bugs": {
66
"url": "https://github.com/Automattic/newspack-plugin/issues"

tests/unit-tests/indesign-exporter/indesign-exporter.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,30 @@ public function test_convert_horizontal_rule() {
277277
$content = $converter->convert_post( $post_id );
278278
$this->assertStringContainsString( '<pstyle:hr>', $content );
279279
}
280+
281+
/**
282+
* Test image caption and credit special characters.
283+
*/
284+
public function test_image_caption_and_credit_special_characters() {
285+
$image_id = $this->factory->attachment->create();
286+
wp_update_post(
287+
[
288+
'ID' => $image_id,
289+
'post_excerpt' => 'Image Caption with á é í ó ú ñ ç ð ð &nbsp;, &amp;, &lt;, &gt; and •.',
290+
]
291+
);
292+
update_post_meta( $image_id, '_media_credit', 'Image Credit with á é í ó ú ñ ç ð ð &nbsp;, &amp;, &lt;, &gt; and •.' );
293+
294+
$post_id = $this->factory->post->create(
295+
[
296+
'post_title' => 'Test Post',
297+
'post_content' => '<!-- wp:image {"id":' . $image_id . '} --><figure class="wp-block-image"><img src="http://localhost/wp-content/uploads/2025/01/image.jpg" /><figcaption class="wp-element-caption">Image Caption with á é í ó ú ñ ç ð ð &nbsp;, &amp;, &lt;, &gt; and •.</figcaption></figure><!-- /wp:image -->',
298+
]
299+
);
300+
301+
$converter = new InDesign_Converter();
302+
$content = $converter->convert_post( $post_id );
303+
$this->assertStringContainsString( '<pstyle:PhotoCaption>Image Caption with <0x00E1> <0x00E9> <0x00ED> <0x00F3> <0x00FA> <0x00F1> <0x00E7> <0x00F0> <0x00F0> , &, <, > and <CharStyle:bullet>n<CharStyle:>.', $content );
304+
$this->assertStringContainsString( '<pstyle:PhotoCredit>Image Credit with <0x00E1> <0x00E9> <0x00ED> <0x00F3> <0x00FA> <0x00F1> <0x00E7> <0x00F0> <0x00F0> , &, <, > and <CharStyle:bullet>n<CharStyle:>.', $content );
305+
}
280306
}

0 commit comments

Comments
 (0)