Added ability to retrieve a work's workskin#110
Conversation
|
Oh, awesome, you wrote this fast! I'll hopefully test it this weekend. While I have not tested this yet, I suspect there may be an issue if the user is logged in and has a site skin enabled, because in that case, there can be several <style> tags, and they may all be site skins, or the last one may be the workskin. If that happens, then additional checks would be necessary to ensure you're actually getting a workskin inside a style tag, perhaps by checking for the "Hide Creator's Style" button and if it's present, getting the last style tag on the page. |
|
Thank you for the fast reply! I previously tested the Site Skins thing and came out of the experience convinced that those were served as a |
|
If it wasn't clear before I consider the 5th commit from March 5th (71234e4) to be the completed version of the "Site Script-compatible version" I mentioned before. I tested it on fics with and without workskins, both while browsing anonymously and while logged in to my account with a site script enabled, and it behaved as expected in all four cases. Is there anything else you need me to do before this can be merged? |
Added a workskin() function in works.py, which returns the contents of the first <style type:"text/css"> tag it can find. In every case I've checked, that tag (if it exists) will contain the CSS code for the 'workskin', custom theming that authors can put on their works. Returns an empty string if there is no workskin.