kxxt / obsidian-advanced-paste

Advanced pasting functionality for obsidian
MIT License
42 stars 2 forks source link

Smart join misses line breaks sometimes? #2

Open half-adder opened 1 year ago

half-adder commented 1 year ago

Love the plugin, exactly what I was looking for to aid in pulling quotes from PDFs.

I'm on Windows, and Smart Join removes lines from pasted text from Adobe Acrobat Pro correctly UNLESS the text was highlighted.

Here is some raw text I got from right clicking a highlighted region and selecting "Copy Text":

To analyze the H2Aub1 genomic profile in embryos lack
ing
PR-DUB catalytic activity, we generated embryos in
which the catalytic Cys131 residue in the PR-DUB sub
unit
Calypso (Caly; also called Bap1) was mutated to ser
CalyC131S
ine
(Supplemental Fig. S2A). The
protein
retains the ability to interact with its partner subunit,
Asx, to form PR-DUB (Scheuermann et al. 2010), and its
expression levels and nuclear localization are indistin
guishable
fromthat of the wild-type Caly protein (Supple
mental
Fig. S2B).

The resulting text from Smart Join looks like this:

To analyze the H2Aub1 genomic profile in embryos lack ing
PR-DUB catalytic activity, we generated embryos in which the catalytic Cys131 residue in the PR-DUB sub unit
Calypso (Caly; also called Bap1) was mutated to ser CalyC131S ine
(Supplemental Fig. S2A). The protein retains the ability to interact with its partner subunit, Asx, to form PR-DUB (Scheuermann et al. 2010), and its expression levels and nuclear localization are indistin guishable
fromthat of the wild-type Caly protein (Supple mental
Fig. S2B).

If I remove the highlight in Adobe Acrobat, and select the text then paste with Smart Join, the pasted text looks as expected:

To analyze the H2Aub1 genomic profile in embryos lacking PR-DUB catalytic activity, we generated embryos in which the catalytic Cys131 residue in the PR-DUB subunit Calypso (Caly; also called Bap1) was mutated to serine (Supplemental Fig. S2A). The CalyC131S protein retains the ability to interact with its partner subunit, Asx, to form PR-DUB (Scheuermann et al. 2010), and its expression levels and nuclear localization are indistinguishable fromthat of the wild-type Caly protein (Supplemental Fig. S2B).
kxxt commented 1 year ago

Hi @half-adder , I am delighted to hear that you love my plugin.

Does your pdf file lack hyphens? It seems that the raw text is missing hyphens where the words are broken by line break.

If possible, could you please send me a pdf file that causes your trouble(or a minimal reproduction)?

Personally I usually use firefox as my PDF reader. Perhaps you can check whether this plugin works when pasting from the highlighted text in firefox.