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
using .innerHTML makes JSON reappear (closes #478) #490
Conversation
Tested in Safari, Chrome, and FF on Mac. |
@iherman, I'm still not comfortable with this. Maybe it's better if you tell us exactly which fields you actually need for what you are doing? |
@marcoscaceres I am not sure what you ask. Are you asking what I would use the respec config from my code if it was there? If so: at this moment it would give me an easy way of finding, e.g., the publication date, the short name, the list of editors and authors, the document status and probably other things. All these information are in the initial respec setup but are thrown away; I must scrape the HTML output to find them. (Eg, find the latest URL relying on a particular class name, extract from the URL format whether it is a REC, or WD, or whatever, and extract the publication date.) I am sure other tools that may want to postprocess the HTML file may find other usage. (If it was only for my tool then I wouldn't have raised this feature request. After all, I have already gone through the trouble of doing it, although it is not future proof as it relies on a particular, and undocumented, structure of the final HTML.) |
Ok, in addition to the above, I want to know the list that makes up "probably other things" (I can make it "all use-setable options, as per our documentation). We are vomiting a lot of ReSpec's internals into the JSON, and I would prefer to only spit out the properties you + others need.
|
@marcoscaceres I would say that anything that the user can set should be visible to the output. We should not come up with a list of "visible" properties imho. |
Sent from my iPhone
The problem is that ReSpec abuses the user's configuration to also configure its own things. What I will do is snapshot the initial configuration (before ReSpec starts changing it) and return that. That should give you what you need without exposing ReSpec's internal config. Sound good?
|
That sounds perfect. Thanks! |
d4ecacb
to
baa0017
Compare
@@ -21,7 +21,7 @@ define( | |||
} | |||
return val; | |||
} | |||
script.innerText = JSON.stringify(conf, confFilter, 2); | |||
script.innerHTML = JSON.stringify(conf.initialUserConfig, confFilter, 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, innerText doesn't work... it doesn't output when respec calls .innerHTML on the root node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this wouldn't work, but frontend dev is full of mysteries.
@tobie r? |
7de9bf5
to
3688827
Compare
@@ -23,6 +23,16 @@ | |||
, embedded = (top !== self) | |||
; | |||
if (!("respecConfig" in window)) window.respecConfig = {}; | |||
// clone the initial user configuration. | |||
try{ | |||
if(Object.assign){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what the convention us but iirc ReSpec has ws all over the place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going to fix all that in #493.
LGTM |
@tobie thanks for the review + time! |
using .innerHTML makes JSON reappear (closes #478)
…accessor on line graphs using tspans. Next step is to implement the argument, then generalize this for the other graph types.
…d to come up with an example for functions.
… are super ugly anyway. Helps toward w3c#490.
For whatever reason, .innerText means that when .toString() is called within the output function, the inner text doesn't show up. However, using .innerHTML means that it does show up.