Skip to content

Commit

Permalink
T284601: Expose plugin helper method getPreviewHtml (#144)
Browse files Browse the repository at this point in the history
* Expose plugin helper method getPreviewHtml

* Update getPreviewHtml and move out of utils

* Add small comment

* Update getPreviewHtml params
  • Loading branch information
medied authored Sep 10, 2021
1 parent 5899ca5 commit 5492ab8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ const invokeCallback = ( events, name, params ) => {
}
}

// getPreviewHtml is meant to be used by the Wordpress plugin only
const getPreviewHtml = ( title, lang, callback ) => {
requestPagePreview( lang, title, data => {
callback( renderPreview( lang, data, isTouch ) )
} )
}

let currentPopupId

function init( {
Expand Down Expand Up @@ -187,4 +194,4 @@ function init( {

version()

export { init, version }
export { init, version, getPreviewHtml }

0 comments on commit 5492ab8

Please sign in to comment.