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
Use config Newline Setting In System Attribute Evaluation (#154) #155
Use config Newline Setting In System Attribute Evaluation (#154) #155
Conversation
…y#154) Problems seen with inconsistent newlines in the Table Of Contents HTML pulled in from the configuration file. While the rest of the contents in the resulting HTML file honored the newline style configured by the user, this specific snippet of HTML always used "\r\n". This root of this problem existed for some time, but in earlier versions, the newline style was always "\n". The symptoms changed as a side effect of the issue "Extra line padding in source and literal blocks" (asciidoc-py#139). In this issue, the newline style changed to "\r\n", and was noticed by users. Change the System Attribute Evaluation function to use the newline setting from the global "config" instead of using the default newline.
Can we also change these two lines to use config.newline while we're at it: Could you add a test case of a file that specifies newline as a configuration option in the test suite? (Feel free to say no, and I can handle this). I'll take a look at the test suite today to get that working. |
This is for #154. I noticed two other areas where DEFAULT_NEWLINE was used, and I did not change them. Both of these were in the context of reading csv files. If they are an issue (which I would need to research more to see if they are), then I don't know if it would be preferred to put it in another PR, or extend this one. |
Fair enough, I did not look very deeply into it, I'll open a separate issue to track that, and we can leave this PR to just focus on the use-case of #154. |
Looks like the tests are failing because of some commands that GitHub deprecated. They no longer allow the Here is the error:
The tests did run fine when I ran them locally.
|
Yup, easy enough fix in #156 and now on master. Would you mind merging master into your branch? |
Thanks. Last bit was just confirming if you think you could add a test case for this? |
Sure, I can add a test case. It will be tonight (or maybe tomorrow) before I will have time to look at it though. But, I have wanted to understand how the tests worked for some time. If you want to get the release out sooner than that, it won't hurt my feelings if you add the test case. :-) |
👍 I'm fine waiting a few days for you to write the test if it means having more collaborators know the repository more fully. |
I pushed an update with the tests for newlines. I added a new test input file that has 3 sections: each section is in a different newline style (DOS/UNIX/MAC). I enabled the TOC so that the original issue would be visible if it ever came back. Let me know if there are any changes you think would be a good idea. |
I looked into the uses of It looks like the caller of the I even tried making a cell have multiple lines in the csv. The output HTML did honor the specified newline (not the newline that was embedded in the csv). Of course, the rendered text for the multi-line cell all appeared to be on one line. Which seems like the correct functionality. I don't see any tests that use a csv file as input for a table. Do you want me to include one in this PR, or reserve that for another? |
Never mind...I see that the tables test is using a csv from the website area. So, I think this PR is ready as-is. |
Thanks for this! The tests look good and the generated html files have the expected line endings. Did a manual test on #154 with provided |
Problems seen with inconsistent newlines in the Table Of Contents HTML pulled in from the configuration file. While the rest of the contents in the resulting HTML file honored the newline style configured by the user, this specific snippet of HTML always used "\r\n".
This root of this problem existed for some time, but in earlier versions, the newline style was always "\n". The symptoms changed as a side effect of the issue "Extra line padding in source and literal blocks" (#139). In this issue, the newline style changed to "\r\n", and was noticed by users.
Change the System Attribute Evaluation function to use the newline setting from the global "config" instead of using the default newline.
Closes #154