Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to fix share action #1

Merged
merged 2 commits into from
Nov 4, 2024
Merged

Trying to fix share action #1

merged 2 commits into from
Nov 4, 2024

Conversation

jeffque
Copy link
Contributor

@jeffque jeffque commented Nov 4, 2024

It added <br> where it shouldn't be. Trying to asks for a \n in hope it helps

It added `<br>` where it shouldn't be. Trying to asks for a `\n` in hope it helps
@jeffque
Copy link
Contributor Author

jeffque commented Nov 4, 2024

Test post on bsky: https://bsky.app/profile/jeffquesado.ulivre.dev/post/3la5bm5jxn32y

Test setup:

Inspect page, select the share element (I added in the DOM an ID to the element), alter the href as this:

const shareable = document.getElementById('shareable') // the id added in the DOM directly
const data = {
  category: {
    title: "Marmota marmotosa"
  },
  handle: "jeffquesado.ulivre.dev"
}

shareable.href = "https://bsky.app/intent/compose?text=" +   
  encodeURI(`I'm __${data.category?.title}__ on 🦋\n\nCheck it out: https://jyc.dev/at/${data.handle}\n\n🫵 Get in, and claim your digital beast too 🐾 ! ?\n\n👀 @jyc.dev `)

@jeffque
Copy link
Contributor Author

jeffque commented Nov 4, 2024

The preview isn't good, but at least it worked 👀

the preview of the share click. It does not show the newline tho

@jeffque
Copy link
Contributor Author

jeffque commented Nov 4, 2024

Also about the share preview: it seems that you were not tagged, but indeed it tags when posting

@jycouet
Copy link
Owner

jycouet commented Nov 4, 2024

Hoooo, sorry I didn't check mail & GitHub!!!

On what browser are you?
For me \n didn't work, but <br> did.

@jeffque
Copy link
Contributor Author

jeffque commented Nov 4, 2024

Hoooo, sorry I didn't check mail & GitHub!!!

On what browser are you?

For me \n didn't work, but <br> did.

Firefox on MacBook.

Perhaps it is something browser specific? Maybe when Firefox is submitting the form it sends the <br> tags to bsky backend instead of something the server recognizes as new line?

@jycouet
Copy link
Owner

jycouet commented Nov 4, 2024

Let's merge this ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants