Comments (12)
Can you send me the MP3 to test? I typically have to do the conversion so it doesn't screw up the HTML on the page.
from jamstash.
Try e.g http://www.nrk.no/urort/1.0/track/download/1504587.mp3 , should say "Bølgeskum", but instead outputs something rather obscene
from jamstash.
What browser/os are you on? Where exactly is it displaying incorrectly?
The title, album & artist all appear correctly for me, including in the player after I hit play. I'm using the latest Chrome on Win7.
from jamstash.
It displays correctly everywhere except in the <title> (ie. top bit of the browser tab/window).
Tested with both Chromium 22.0.1229.94 and Firefox 16.0.1 on Arch Linux.
Also, possibly relevant: if I do Ctrl+Shift+K (or Ctrl+Shift+I in Chromium) and type
toHTML.un("AøBC")
it outputs "AøC", ie. it removes the B.
from jamstash.
wops, seems < and > are not escaped in comments here, that was probably another source of confusion …
from jamstash.
Hmmm, I'm not seeing this on Windows. The title show up as expected in Chrome & FF.
This is the function that does the unicode conversion. I would need to find one that is a little more robust to support Linux cause it looks like it does things differently. I'm not sure what else to do...
var toHTML = {
on: function (str) {
var a = [],
i = 0;
for (; i < str.length; ) a[i] = str.charCodeAt(i++);
return "&#" + a.join(";&#") + ";"
},
un: function (str) {
return str.replace(/&#(x)?([^&]{1,5});?/g,
function (a, b, c) {
return String.fromCharCode(parseInt(c, b ? 16 : 10))
})
}
};
from jamstash.
That regex has [^&] – it looks like the intention is [^;], no? Seems to fix it anyway.
Otherwise, this alternative also seems to work here (and would take named entities too, but perhaps that never happens?):
function htmlDecode(input){
var e = document.createElement('div');
e.innerHTML = input;
out = e.childNodes[0].nodeValue;
$(e).remove();
return out;
}
from jamstash.
Does changing the [^&] to [^;] fix this issue for you? I didn't write the function, just copied it from somewhere.
from jamstash.
It does. I'm assuming it should be matching one whole entity, like
{
so it makes sense to use
[^;]*
as way of matching everything up until the ;
EDIT: plaintext (why are these comments not plaintext by default? ugh)
from jamstash.
Can you paste a copy of what you changed the toHtml function to? Just adding [^;] isn't working, I'd like to see the whole thing.
from jamstash.
var toHTML = {
on: function (str) {
var a = [],
i = 0;
for (; i < str.length; ) a[i] = str.charCodeAt(i++);
return "&#" + a.join(";&#") + ";"
},
un: function (str) {
return str.replace(/&#(x)?([^;]{1,5});?/g,
function (a, b, c) {
return String.fromCharCode(parseInt(c, b ? 16 : 10))
})
}
};
(again, sorry for not noticing that my previous comment was parsed as html instead of posted verbatim…)
from jamstash.
I think this is fixed, thanks man!
from jamstash.
Related Issues (20)
- settings to connect to localhost HOT 5
- Make this error more specific: "Error when contacting the Subsonic server. The requested data was not found." HOT 1
- Javascript error when invalid host is set in the settings HOT 1
- Feature Request: Save queue (and position in queue) across sessions HOT 2
- Support for Ampache music libraries HOT 2
- Initial load does not reflect folder selection
- Next Button HOT 3
- Please use https HOT 1
- Playlist Actions buttons improperly formatted HOT 7
- Jamstash chrome extension claims Subsonic server license has expired
- Utilize GitHub's release functionality (and simplify dist folder management) HOT 1
- Website Down HOT 2
- Https redirects to an unknown site HOT 2
- Remote jukebox mode ? HOT 2
- Auto remove tracks after playing
- Error since 4.7.0 - Loading failed for the <script> HOT 2
- jplayer won't play FLAC HOT 2
- "Auto Albums" to use the selected folder
- Procedure described in GettingStarted wiki not working HOT 1
- Replaygain support HOT 1
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 jamstash.