Comments (11)
Nono I mean split into list, strip the strings in it, then join the list with separator newline (and quote sign I suppose).
Though by all means dropping newlines alltogether is also an option
from blottertrax.
I can't see the comment so I don't understand the problem, but a double newline shouldnt cause that issue. In my experience \n>\n> will correctly be identified as a new paragraph in the quote by reddit. Any chance I could have a screenshot of the comment?
from blottertrax.
Artist: https://www.last.fm/music/Mischief+Brew
from blottertrax.
This looks like it could be a code block? that would be caused by a series of spaces in the beginning of the line (at least 4)
I am almost certain it is not a nested quote, though I don't know new reddit
from blottertrax.
from blottertrax.
hm i did some more testing and im not quite sure, I dont think its possible to have code block in quote?
Could someone with access do a getSubmission request on the comment and get the raw body data from the api?
from blottertrax.
The summary is:
"Mischief Brew was an anarchist folk-punk band. A wicked concoction by Erik Petersen – a musical feast falling somewhere between the categories of pirate punk, Celtic folk, gypsy swing, devilish jazz, American olde-tyme and country. It’s good music to stomp, kick, pogo, jitterbug, waltz, drink, twist and shout to – whether the performance is solo acoustic or with a backing band of accordion, drums, and mandolin.\n\n Erik started making music at a young age <a href=\"https://www.last.fm/music/Mischief+Brew\">Read more on Last.fm</a>"
Github doesn't format this properly either but the key piece is that the \n\n is followed by 12 spaces.
Perhaps we run it through
re.sub("\n+", "\n>", re.sub('\s+',' ', description))
I think that'll clobber both the extra lines (replacing them with a single quote for our need) as well as stripping excess spaces from the text body.
from blottertrax.
using native split function, then strip and join also can. It's not going to get rid of mid-text double space, but it will handle the main issue and should be faster than regex
from blottertrax.
@TcMaX : I think that would remove newlines as well though wouldn't it?
Edit: Although considering we are getting the short description it might not be that bad. We could split, strip, join then append > to the front (for reddit markdown) and call it a day. The resulting paragraph shouldn't be so long we really care about the newlines anyway.
from blottertrax.
So something like
summarySplit = summary.split('\n') strippedList = list(map(str.strip, summarySplit)) newSummary = '\n>'.join(strippedList)
Completely untested, but something in this ballpark. I think it'd be a fair bit faster than regex
EDIT: I really did try to newline things in this code block, it didn't work.
from blottertrax.
seems to work. obviously first one no quote but thats easy fix
from blottertrax.
Related Issues (20)
- Add MusicBrainz link to ‘Socials’
- Abstract title regex to own class so tests can work in actions step
- Further expand artist/song title extraction HOT 5
- Make exclusion list of artists HOT 1
- Set requirement dependencies to update untill next major version HOT 1
- TitleParser exception causing crash HOT 1
- Remove old data from the database
- Key errors in artist description
- Remove artist description when post score is 0 HOT 2
- Ensure artist description links are good HOT 3
- Properly label social networks in the description reply HOT 1
- Ensure description gets sanitized for markdown formatting HOT 2
- Free streaming links should be parsed to show the streaming service
- Track named returned instead of album title HOT 2
- Link to artist's Last.fm page should be be included in automatic removal message HOT 4
- Feature request: Include Track Information HOT 3
- Add ability to override limits in config file
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- It should use the first album release, not the last
- Multiprocessing output not logged in docker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blottertrax.