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

🐛 BUG: Syntax colors are behaving strangely #709

Closed
reggi opened this issue Nov 23, 2023 · 0 comments
Closed

🐛 BUG: Syntax colors are behaving strangely #709

reggi opened this issue Nov 23, 2023 · 0 comments
Labels
needs triage Issue needs to be triaged

Comments

@reggi
Copy link

reggi commented Nov 23, 2023

Describe the Bug

Screenshot 2023-11-23 at 11 18 07 AM

Steps to Reproduce

make astro file with this content?

---
import '@/tweet.css';
import { expandTwitterShortenedUrlsRemoveTwitterAnchors } from '@/lib/cheerio'

export interface Props {
	id: string;
}
const { id } = Astro.props;

async function fetchTweet(id: string) {
	try {
		const oembedUrl = new URL('https://publish.twitter.com/oembed');
		oembedUrl.searchParams.set('url', id);
		oembedUrl.searchParams.set('omit_script', 'true');
		oembedUrl.searchParams.set('dnt', 'true');
		return (await fetch(oembedUrl).then((res) => res.json())) as {
			url: string;
			author_name: string;
			author_url: string;
			html: string;
		};
	} catch (e) {
		console.error(
			`[error]  astro-embed
         ${e.status} - ${e.statusText}: Failed to fetch tweet ${id}`
		);
	}
}

const tweet = await fetchTweet(id);
const html = (await expandTwitterShortenedUrlsRemoveTwitterAnchors(tweet?.html.replace(/twitter.com/g, 'nitter.net'))).html()
---

{tweet && <astro-embed-tweet set:html={html} />}
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Nov 23, 2023
@reggi reggi closed this as completed Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant