From 873dcc18921de3510b8a2c4719dec43499d9c6bb Mon Sep 17 00:00:00 2001 From: jamesvici Date: Tue, 15 Sep 2026 19:39:12 -0400 Subject: [PATCH] Expand [caption] shortcodes instead of emitting them as text WordPress expands shortcodes at render time via do_shortcode(), so the raw post_content the export reads still contains them literally. All ten [caption] instances were being written straight into the Markdown and rendered as visible markup -- the Hosting page led with [caption id="attachment_205" align="aligncenter" width="300"]. They now become the same div.wp-caption / p.wp-caption-text structure WordPress produces, which the ported theme CSS already styles. The shortcode is swapped for a placeholder before the HTML->Markdown pass and rebuilt after, so the image inside stays Markdown and still goes through Astro's image pipeline rather than being frozen as raw HTML pointing into src/assets, which would not resolve at runtime. [caption] is the only shortcode in use -- no gallery/embed/video/audio. Co-Authored-By: Claude Opus 5 --- scripts/export-wp.mjs | 42 ++++++++++++++++++- src/content/pages/cepstral-text-to-speech.md | 7 +++- src/content/pages/dnc-com-integration.md | 7 +++- src/content/pages/hosting.md | 7 +++- .../pages/orecx-audio-and-screen-recording.md | 7 +++- src/content/pages/queuemetrics-reporting.md | 7 +++- src/content/pages/rankminer-call-analytics.md | 7 +++- .../pages/sangoma-call-progress-analysis.md | 7 +++- ...nologies-in-2016-by-cio-review-magazine.md | 7 +++- src/content/pages/vicidial-screenshots.md | 7 +++- .../vicihost-high-level-data-encryption.md | 7 +++- 11 files changed, 100 insertions(+), 12 deletions(-) diff --git a/scripts/export-wp.mjs b/scripts/export-wp.mjs index e0efc98..542679d 100644 --- a/scripts/export-wp.mjs +++ b/scripts/export-wp.mjs @@ -100,6 +100,35 @@ function rewriteInternalLinks(html, linkMap, unresolved) { ); } +// WordPress expands [caption] at render time via do_shortcode(); the raw post_content keeps it +// literal, so it has to be expanded here or it shows up as visible markup on the page. +// The shortcode is swapped for a placeholder before the HTML->Markdown conversion and rebuilt +// afterwards, so the inside still goes through Turndown (and therefore still gets picked +// up by Astro's image pipeline) rather than being frozen as raw HTML pointing into src/assets. +const CAPTION_PLACEHOLDER = (i) => `CAPTIONPLACEHOLDER${i}END`; + +function extractCaptions(html, captions) { + return html.replace(/\[caption([^\]]*)\]([\s\S]*?)\[\/caption\]/gi, (_match, attrs, inner) => { + const lastTag = inner.lastIndexOf('>'); + captions.push({ + align: (attrs.match(/align=["']?(align\w+)["']?/i) || [, 'aligncenter'])[1], + width: (attrs.match(/width=["']?(\d+)["']?/i) || [, ''])[1], + mediaHtml: inner.slice(0, lastTag + 1), + text: inner.slice(lastTag + 1).trim(), + }); + return CAPTION_PLACEHOLDER(captions.length - 1); + }); +} + +// Blank lines around the image are load-bearing: they close the surrounding raw HTML block so +// the image is parsed as Markdown rather than swallowed as literal HTML. +function buildCaption({ align, width, mediaHtml, text }) { + const media = turndown.turndown(mediaHtml).trim(); + const style = width ? ` style="width: ${Number(width) + 10}px"` : ''; + const caption = text ? `\n

${text}

` : ''; + return `
\n\n${media}\n${caption}\n
`; +} + async function buildLinkMap(conn) { const [rows] = await conn.execute( `SELECT ID, post_type, post_name FROM ${TABLE_PREFIX}posts @@ -134,11 +163,20 @@ async function exportPostType(conn, postType, destDir, { attachmentPaths, thumbn } html = rewriteImageUrls(html, destDir); html = rewriteInternalLinks(html, linkMap, unresolved); - const markdown = turndown.turndown(html); + + const captions = []; + html = extractCaptions(html, captions); + const markdown = turndown + .turndown(html) + .replace(/CAPTIONPLACEHOLDER(\d+)END/g, (_m, i) => buildCaption(captions[Number(i)])); let excerpt = fixLiteralNewlines(row.post_excerpt || ''); if (!excerpt) { - const plain = html.replace(/<[^>]+>/g, ' ').replace(/\s+/g, ' ').trim(); + const plain = html + .replace(/CAPTIONPLACEHOLDER\d+END/g, ' ') + .replace(/<[^>]+>/g, ' ') + .replace(/\s+/g, ' ') + .trim(); // 60 words: what the theme's front-page loop sets ($sbExcerptLength = 60). // The slideshow truncates this further to 30 at render, as the theme does. excerpt = plain.split(' ').slice(0, 60).join(' '); diff --git a/src/content/pages/cepstral-text-to-speech.md b/src/content/pages/cepstral-text-to-speech.md index bf15930..0b4f8bc 100644 --- a/src/content/pages/cepstral-text-to-speech.md +++ b/src/content/pages/cepstral-text-to-speech.md @@ -3,7 +3,12 @@ title: "Cepstral Text-to-Speech" slug: "cepstral-text-to-speech" --- -\[caption id="attachment\_346" align="aligncenter" width="344"\][![Cepstral Text-to-Speech](../../assets/uploads/2016/03/cepstral_top_logo.png)](../../assets/uploads/2016/03/cepstral_top_logo.png) Cepstral Text-to-Speech\[/caption\]VICIdial integrates with Cepstral Text-to-Speech to provide dynamic audio messages per-lead for outbound and inbound calling. +
+ +[![Cepstral Text-to-Speech](../../assets/uploads/2016/03/cepstral_top_logo.png)](../../assets/uploads/2016/03/cepstral_top_logo.png) + +

Cepstral Text-to-Speech

+
VICIdial integrates with Cepstral Text-to-Speech to provide dynamic audio messages per-lead for outbound and inbound calling. The VICIdial Outbound survey auto-dialing features have built-in administrative utilities to allow for Cepstral to generate dynamic per-lead messages almost instantly once a customer picks up the line. diff --git a/src/content/pages/dnc-com-integration.md b/src/content/pages/dnc-com-integration.md index b34c8c6..8b64265 100644 --- a/src/content/pages/dnc-com-integration.md +++ b/src/content/pages/dnc-com-integration.md @@ -3,7 +3,12 @@ title: "DNC.com Integration" slug: "dnc-com-integration" --- -\[caption id="attachment\_340" align="aligncenter" width="219"\][![DNC.com logo](../../assets/uploads/2016/03/DNCcomlogo.png)](../../assets/uploads/2016/03/DNCcomlogo.png) DNC.com logo\[/caption\]VICIdial has built-in utilities to integrate with several DNC.com features. +
+ +[![DNC.com logo](../../assets/uploads/2016/03/DNCcomlogo.png)](../../assets/uploads/2016/03/DNCcomlogo.png) + +

DNC.com logo

+
VICIdial has built-in utilities to integrate with several DNC.com features. Included in the integration are filtering by your DNC.com lists and settings, as well as filtering your lists by the U.S.A cellphone lists for better TCPA compliance when calling within the United States. diff --git a/src/content/pages/hosting.md b/src/content/pages/hosting.md index 9eb173f..6abed57 100644 --- a/src/content/pages/hosting.md +++ b/src/content/pages/hosting.md @@ -3,7 +3,12 @@ title: "Hosting" slug: "hosting" --- -\[caption id="attachment\_205" align="aligncenter" width="300"\][![VICIhost Hosted Contact Center Solution](../../assets/uploads/2015/11/vicihost-logo_300x100.jpg)](http://www.vicihost.com) VICIhost Hosted Contact Center Solution\[/caption\]
+
+ +[![VICIhost Hosted Contact Center Solution](../../assets/uploads/2015/11/vicihost-logo_300x100.jpg)](http://www.vicihost.com) + +

VICIhost Hosted Contact Center Solution

+

If you don't want to have to manage your own VICIdial equipment, then let the experts do it for you! The Vicidial Group's VICIhost service can get you up and running today on your own dedicated server in our custom built server cloud. diff --git a/src/content/pages/orecx-audio-and-screen-recording.md b/src/content/pages/orecx-audio-and-screen-recording.md index 621cfbe..5562e1b 100644 --- a/src/content/pages/orecx-audio-and-screen-recording.md +++ b/src/content/pages/orecx-audio-and-screen-recording.md @@ -3,7 +3,12 @@ title: "OrecX Audio and Screen Recording" slug: "orecx-audio-and-screen-recording" --- -\[caption id="attachment\_352" align="aligncenter" width="600"\][![OrecX recording](../../assets/uploads/2016/03/OrecX_logo-600.png)](../../assets/uploads/2016/03/OrecX_logo-600.png) OrecX recording\[/caption\]Even though VICIdial can natively record phone calls, integration with the OrecX suite of recording utilities allows for recording of any VOIP phone calls on your network, as well as the option to record the agents' screens and have them tied to the lead that the agent is talking to. +
+ +[![OrecX recording](../../assets/uploads/2016/03/OrecX_logo-600.png)](../../assets/uploads/2016/03/OrecX_logo-600.png) + +

OrecX recording

+
Even though VICIdial can natively record phone calls, integration with the OrecX suite of recording utilities allows for recording of any VOIP phone calls on your network, as well as the option to record the agents' screens and have them tied to the lead that the agent is talking to. For more information about OrecX, [please contact us](/contact-us). diff --git a/src/content/pages/queuemetrics-reporting.md b/src/content/pages/queuemetrics-reporting.md index 5948b30..61c6e29 100644 --- a/src/content/pages/queuemetrics-reporting.md +++ b/src/content/pages/queuemetrics-reporting.md @@ -3,7 +3,12 @@ title: "QueueMetrics Reporting" slug: "queuemetrics-reporting" --- -\[caption id="attachment\_334" align="aligncenter" width="253"\][![QueueMetrics logo](../../assets/uploads/2016/03/QueueMetrics_logo.png)](../../assets/uploads/2016/03/QueueMetrics_logo.png) QueueMetrics logo\[/caption\]QueueMetrics is a third-party reporting package that allows you to visualize call center activities in several different ways. +
+ +[![QueueMetrics logo](../../assets/uploads/2016/03/QueueMetrics_logo.png)](../../assets/uploads/2016/03/QueueMetrics_logo.png) + +

QueueMetrics logo

+
QueueMetrics is a third-party reporting package that allows you to visualize call center activities in several different ways. VICIdial fully integrates with the QueueMetrics statistical analysis package through it's ability to log calls and agent activity to a queue\_log table in a MySQL database. diff --git a/src/content/pages/rankminer-call-analytics.md b/src/content/pages/rankminer-call-analytics.md index 1a46d74..416e997 100644 --- a/src/content/pages/rankminer-call-analytics.md +++ b/src/content/pages/rankminer-call-analytics.md @@ -5,4 +5,9 @@ slug: "rankminer-call-analytics" ### Helping Call Centers Improve Agent Performance and Close More Sales -\[caption id="attachment\_361" align="aligncenter" width="650"\][![Rankminer Dashboard Screen](../../assets/uploads/2016/03/Rankminer-dashboard-example_20160319-1024x601.png)](../../assets/uploads/2016/03/Rankminer-dashboard-example_20160319.png) Rankminer Dashboard Screen\[/caption\] RankMiner is a leading pioneer in the field of predictive voice analytics. RankMiner’s products use patented technology to analyze the emotional behavior and tone of speakers in a conversation. They create predictive models of future behavior enabling RankMiner’s customers to improve conversion rates, operational effectiveness and agent performance. In more simple terms, RankMiner can help you make more sales by helping you to target the right leads. It can also operate as an automated layer of quality control for your agents. [**To learn how one of our VICIhost clients increased their sales by over 40% by using RankMiner, click here.**](/vicidial-partners-with-rankminer-and-its-customer-insight-agent-insight-products-to-increase-call-center-effectiveness) [View RankMiner's Agent Performance white paper to discover how voice analytics can improve your call agent performance.](http://offers.rankminer.com/using-artificial-intelligence-monitor-measure-call-center-agent-performance) For more information on RankMiner Analytics, [please contact us](/contact-us). **Note: As of September 2020, Rankminer is no longer an operating company.**
To go back to the third-party add-ons page, [click here](/third-party-add-ons). +
+ +[![Rankminer Dashboard Screen](../../assets/uploads/2016/03/Rankminer-dashboard-example_20160319-1024x601.png)](../../assets/uploads/2016/03/Rankminer-dashboard-example_20160319.png) + +

Rankminer Dashboard Screen

+
RankMiner is a leading pioneer in the field of predictive voice analytics. RankMiner’s products use patented technology to analyze the emotional behavior and tone of speakers in a conversation. They create predictive models of future behavior enabling RankMiner’s customers to improve conversion rates, operational effectiveness and agent performance. In more simple terms, RankMiner can help you make more sales by helping you to target the right leads. It can also operate as an automated layer of quality control for your agents. [**To learn how one of our VICIhost clients increased their sales by over 40% by using RankMiner, click here.**](/vicidial-partners-with-rankminer-and-its-customer-insight-agent-insight-products-to-increase-call-center-effectiveness) [View RankMiner's Agent Performance white paper to discover how voice analytics can improve your call agent performance.](http://offers.rankminer.com/using-artificial-intelligence-monitor-measure-call-center-agent-performance) For more information on RankMiner Analytics, [please contact us](/contact-us). **Note: As of September 2020, Rankminer is no longer an operating company.**
To go back to the third-party add-ons page, [click here](/third-party-add-ons). diff --git a/src/content/pages/sangoma-call-progress-analysis.md b/src/content/pages/sangoma-call-progress-analysis.md index 8f412d0..35e4895 100644 --- a/src/content/pages/sangoma-call-progress-analysis.md +++ b/src/content/pages/sangoma-call-progress-analysis.md @@ -3,7 +3,12 @@ title: "Sangoma Call Progress Analysis" slug: "sangoma-call-progress-analysis" --- -\[caption id="attachment\_357" align="aligncenter" width="408"\][![Sangoma Lyra Answering Machine Detection](../../assets/uploads/2016/03/sangoma_lyra_amd_logo.png)](../../assets/uploads/2016/03/sangoma_lyra_amd_logo.png) Sangoma Lyra Answering Machine Detection\[/caption\]
**NOTE: Sangoma stopped selling their Lyra product in 2017. If you have a valid Lyra license for your server, it will still work with VICIdial, but you can no longer purchase new licenses at this point.** +
+ +[![Sangoma Lyra Answering Machine Detection](../../assets/uploads/2016/03/sangoma_lyra_amd_logo.png)](../../assets/uploads/2016/03/sangoma_lyra_amd_logo.png) + +

Sangoma Lyra Answering Machine Detection

+

**NOTE: Sangoma stopped selling their Lyra product in 2017. If you have a valid Lyra license for your server, it will still work with VICIdial, but you can no longer purchase new licenses at this point.** VICIdial is integrated with the Sangoma/ParaXip CPD SIP gateway. This product is a proprietary Answering machine/Fax machine/Pre-Answer call progress detection engine that claims up to 95% accuracy in very fast detection of humans and machines on calls. diff --git a/src/content/pages/vicidial-declared-one-of-the-most-promising-contact-center-technologies-in-2016-by-cio-review-magazine.md b/src/content/pages/vicidial-declared-one-of-the-most-promising-contact-center-technologies-in-2016-by-cio-review-magazine.md index bf33ef5..087ef8a 100644 --- a/src/content/pages/vicidial-declared-one-of-the-most-promising-contact-center-technologies-in-2016-by-cio-review-magazine.md +++ b/src/content/pages/vicidial-declared-one-of-the-most-promising-contact-center-technologies-in-2016-by-cio-review-magazine.md @@ -5,7 +5,12 @@ slug: "vicidial-declared-one-of-the-most-promising-contact-center-technologies-i VICIdial was chosen as one of the Top 20 Most Promising Contact Center Technology Providers for 2016 by CIO Review magazine. -\[caption id="attachment\_421" align="aligncenter" width="252"\][![CIO Review most promising call center technology providers for 2016](../../assets/uploads/2016/06/CIOreview_most-promosing_2016.png)](../../assets/uploads/2016/06/CIOreview_most-promosing_2016.png) CIO Review most promising call center technology providers for 2016\[/caption\] +
+ +[![CIO Review most promising call center technology providers for 2016](../../assets/uploads/2016/06/CIOreview_most-promosing_2016.png)](../../assets/uploads/2016/06/CIOreview_most-promosing_2016.png) + +

CIO Review most promising call center technology providers for 2016

+
Click the link below to read the article:
[**CIO Review 2016 Profile of VICIdial**](../../assets/uploads/2016/07/CIOreview_july2016_profile_VICIdial.pdf) diff --git a/src/content/pages/vicidial-screenshots.md b/src/content/pages/vicidial-screenshots.md index 4f3c408..61f740f 100644 --- a/src/content/pages/vicidial-screenshots.md +++ b/src/content/pages/vicidial-screenshots.md @@ -41,7 +41,12 @@ slug: "vicidial-screenshots" ### Website Customer Chat Screen -\[caption id="attachment\_514" align="alignleft" width="572"\][![VICIchat Customer Website Chat](../../assets/uploads/2018/05/chat_customer_screenshot_20160818.png)](../../assets/uploads/2018/05/chat_customer_screenshot_20160818.png) This is an example of what the customer will see during a VICIdial website customer chat. There is also an option once the chat session is complete, to send the customer to a survey website.\[/caption\] +
+ +[![VICIchat Customer Website Chat](../../assets/uploads/2018/05/chat_customer_screenshot_20160818.png)](../../assets/uploads/2018/05/chat_customer_screenshot_20160818.png) + +

This is an example of what the customer will see during a VICIdial website customer chat. There is also an option once the chat session is complete, to send the customer to a survey website.

+
### Agent Screen(with multi-form feature) diff --git a/src/content/pages/vicihost-high-level-data-encryption.md b/src/content/pages/vicihost-high-level-data-encryption.md index e55ddf0..9bcad5b 100644 --- a/src/content/pages/vicihost-high-level-data-encryption.md +++ b/src/content/pages/vicihost-high-level-data-encryption.md @@ -3,7 +3,12 @@ title: "VICIhost High-Level Data Encryption" slug: "vicihost-high-level-data-encryption" --- -\[caption id="attachment\_324" align="aligncenter" width="930"\][![VICIhost high-level data encryption](../../assets/uploads/2016/03/main_page_big_image_encryption.png)](../../assets/uploads/2016/03/main_page_big_image_encryption.png) VICIhost high-level data encryption\[/caption\]With the VICIhost Hosted VICIdial service, you can use NIST-approved high-Level data encryption to protect your customer's sensitive data. These features can also allow you to be PCI-compliant in how you store and access customer data. +
+ +[![VICIhost high-level data encryption](../../assets/uploads/2016/03/main_page_big_image_encryption.png)](../../assets/uploads/2016/03/main_page_big_image_encryption.png) + +

VICIhost high-level data encryption

+
With the VICIhost Hosted VICIdial service, you can use NIST-approved high-Level data encryption to protect your customer's sensitive data. These features can also allow you to be PCI-compliant in how you store and access customer data. [**Click here for more information on VICIhost High-Level Data Encryption**](http://www.vicihost.com/?p=131).