diff --git a/app/bibleview-js/src/components/StudyPadRow.vue b/app/bibleview-js/src/components/StudyPadRow.vue index 9d0b394f0f..4ea4890c71 100644 --- a/app/bibleview-js/src/components/StudyPadRow.vue +++ b/app/bibleview-js/src/components/StudyPadRow.vue @@ -178,7 +178,7 @@ const bibleUrl = computed( const osis = bookmarkItem.osisRef; if(exportMode.value) { - return formatExportLink({ref: osis, v11n: bookmarkItem.v11n}) + return formatExportLink({ref: osis, v11n: bookmarkItem.v11n, doc: bookmarkItem.bookInitials}); } else { return `osis://?osis=${osis}&v11n=${bookmarkItem.v11n}`; } diff --git a/app/bibleview-js/src/utils.ts b/app/bibleview-js/src/utils.ts index 6c315fd9f3..419d8bb459 100644 --- a/app/bibleview-js/src/utils.ts +++ b/app/bibleview-js/src/utils.ts @@ -639,6 +639,7 @@ export function sprintf(format: string, ...args: any[]) { } export function formatExportLink({ref, v11n, doc}: {ref: string, v11n: string, doc?: string}) { - const docStr = doc ? `&document=${doc}`: "" - return `https://stepbible.org/?q=reference=${ref}&v11n=${v11n}${docStr}` -} \ No newline at end of file + const docStr = doc ? `|version=${doc}`: "" + // this is parsed in MainBibleActivity::openLink(uri: Uri) function for intent parsing + return `https://stepbible.org/?q=reference=${ref}${docStr}&v11n=${v11n}` +} diff --git a/app/src/main/java/net/bible/android/view/activity/page/MainBibleActivity.kt b/app/src/main/java/net/bible/android/view/activity/page/MainBibleActivity.kt index a06fefd520..3ec0fef027 100644 --- a/app/src/main/java/net/bible/android/view/activity/page/MainBibleActivity.kt +++ b/app/src/main/java/net/bible/android/view/activity/page/MainBibleActivity.kt @@ -1065,18 +1065,21 @@ class MainBibleActivity : CustomTitlebarActivityBase() { windowControl.showLink(doc, key) } "stepbible.org" -> { - val docStr = uri.getQueryParameter("document") - val doc = if (docStr != null) Books.installed().getBook(docStr) else null + val qParam = uri.getQueryParameter("q") ?: return + + val docRegex = Regex("""version=([^&|]+)""") + val refRegex = Regex("""reference=([^&|]+)""") + + val versionMatch = docRegex.find(qParam) + val version = if (versionMatch != null) versionMatch.groups[1]?.value else null + val doc = if (version != null) Books.installed().getBook(version) else null val defV11n = if (doc is SwordBook) doc.versification else KJVA val v11nStr = uri.getQueryParameter("v11n") val v11n = if (v11nStr == null) defV11n else Versifications.instance().getVersification(v11nStr) ?: defV11n - val refStr = uri.getQueryParameter("q")?:return - val refRegex = Regex("""reference=(.*)""") - val match = refRegex.find(refStr) ?: return - - val keyStr = match.groups[1]?.value ?: return + val refMatch = refRegex.find(qParam) ?: return + val keyStr = refMatch.groups[1]?.value ?: return val key = PassageKeyFactory.instance().getKey(v11n, keyStr) windowControl.showLink(doc, key)