dhowe / ReadersJS

1 stars 4 forks source link

improve 'Focused reader' output for Perigram readers and sub-classes #129

Closed shadoof closed 7 years ago

shadoof commented 7 years ago

@dhowe It seems each line of the focused reader display is an html entity? which means it is not easy to run the texts=words of each reader step together separated by spaces rather than (html) returns? Can you advise on the best way to do this? To make it possible to only start a new line in the focused reader display when certain conditions are met?

(If you wanted to look at the Cayley branch, you'd see the sort of thing that I am trying to do by testing trigram counts and adding an extra line feed (this only works if the "\n" is added before the msg (another html related problem I think).

dhowe commented 7 years ago

Yes, each reader message is its own paragraph object in the DOM, with certain entities (spaces & line-breaks) replaced with their HTML equivalents. With 02b1dba39, this can be configured on a per-reader basis by overriding Reader.outputAsHTML(). Instead of paragraph tags, you might want to use span tags instead.

Alternatively, you can simply set empty (or undefined) messages in textForServer() until you have created a single message from multiple reader 'steps', and then send it whenever ready.

shadoof commented 7 years ago

@dhowe Sounds good: just what I need.

shadoof commented 7 years ago

Closing this, although you're welcome to reopen, but it might be better to open tickets that target specifics of the now improved focused reader display.