Closed manton closed 1 year ago
Thanks @manton – I'll have a look into this.
I can replicate the crash, but it's not showing the root cause of why it's happening. Still investigating.
OK, can see the issue when debugging the actual share extension.
@vincentritter I think I'm going to tweak the text a little so it matches the web app when making a new post from a highlight. Also will look at restoring the bookmark feature, which I think broke with this.
That's a good catch!
Have a look at the following in "/src/stores/Share.js", line 230:
can_save_as_bookmark() {
return self.share_type === "text" && self.share_text.length > 0 && (self.share_text.startsWith("http://") || self.share_text.startsWith("https://")) && string_checker._validate_url(self.share_text)
}
You'll have to change the "share_type" to json
as that's new now, plus the actual text check too, to take into account the markdown.
@manton – I made tweaks in this branch: https://github.com/microdotblog/microblog-react/tree/feature/share-sheet-tweaks
It'll offer to save the bookmark correctly now.
Feel free to use that branch to make your other tweaks.
In version 2.x, if you select text in Safari and use the share toolbar button (not the context menu), it will grab both the selected text and the web page URL to include in the draft Markdown post. I'm remembering now that this requires setting a JavaScript file that runs inside Safari and can extract the info via the DOM or whatever.
@vincentritter I've checked this into the
fix/share-selected-text
branch. However, I'm hitting my head against crashes and other debugging problems, so haven't figured out what is missing yet to finish reimplementing this feature. It may require tweaks to theReactNativeShareMenu
code.