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

[feature request] A tool to copy text including style #60

Open
lindhe opened this issue Dec 29, 2019 · 2 comments
Open

[feature request] A tool to copy text including style #60

lindhe opened this issue Dec 29, 2019 · 2 comments
Labels
+feature New user-facing feature

Comments

@lindhe
Copy link
Contributor

lindhe commented Dec 29, 2019

I'd like to copy a piece of styled text on Sweclockers (e.g., someone's signature). But since Sweclockers use BBCode, I'd need some function to convert from the HTML (which is easy to copy) back to BBCode (so that it can be rendered again).

Not sure if I'll spend the time implementing it, but just putting it here as an idea.

@SimonAlling SimonAlling added the +feature New user-facing feature label Jan 6, 2020
@SimonAlling
Copy link
Owner

This might actually be a pretty fun problem to try and solve.

@SimonAlling
Copy link
Owner

Tried a bit with html2bbcode. It works fairly well in some cases, but since SweClockers generates some custom/non-semantic HTML, it can't handle e.g. quotes.

BBCode source:

[quote postid="18536029" userid="175899" name="Alling"]
Hej!
[/quote]
Halloj!

Generated HTML:

<div class="bbQuote isExpanded"><div class="quoteHead"><span class="quoteToggle" style="display: none;"></span><span style="display: none;">Citat:</span><span style="display: inline;"><span>Skrivet av </span><span>Alling</span><span>:</span></span></div><div class="quoteFrame"><div class="quoteContent">
			<p class="bbParagraph"><span>Hej!</span></p>
		</div><div class="quoteLink" style="display: block;"><a href="/forum/post/18536029">Gå till inlägget</a></div><div class="quoteFade" title="Klicka för att visa hela citatet"></div></div></div>
<p class="bbParagraph"><span>Halloj!</span></p>

Reversed BBCode from html2bbcode:

Citat:Skrivet avAlling:
Hej!
[url=/forum/post/18536029]Gå till inlägget[/url]
Halloj!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
+feature New user-facing feature
Projects
None yet
Development

No branches or pull requests

2 participants