Closed (fixed)
Project:
Recipe
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2008 at 11:53 UTC
Updated:
19 Feb 2010 at 17:00 UTC
If you use HTML entities (like I use °, i.e.: 350°F) in a recipes' instructions you cannot export that recipe in RecipeML format. I found that changing line 913 in recipe.module, which had previously been:
' <directions>' . $node->instructions . '</directions>'."\n".
into the following:
' <directions>' . htmlentities($node->instructions,ENT_COMPAT,'UTF-8') . '</directions>'."\n".
fixed this problem.
Comments
Comment #1
nancydruhttp://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Future... - is bad HTML
Comment #2
sclathrop commentedNancyDru -
Are you stating that my use of the ° symbol contributes to bad HTML, the RecipeML DTD is itself bad HTML, the htmlentities function outputs bad HTML, or something else entirely? Not to be obtuse, but after reading the reference you linked to I still don't understand your reply.
Thank you in advance for clarifying it!
- Stuart
Comment #3
nancydru<directions>is bad HTML according to that article.Comment #4
nancydruBTW, if the module is not outputting XHTML 1.0 Strict, then file an issue and demand it. This is Drupal standards.
Comment #5
brdwor commentedRecipeML output is XML 1.0 not XHTML and this issue was opened concerning the XML output not XHTML that is compiled into a drupal page. -> http://www.formatdata.com/recipeml/spec/recipeml-spec.html
The element is defined in recipeml dtd: http://www.formatdata.com/recipeml/recipeml.dtd, and therefore is not incorrect.
Also, please note that the code change suggested by sclathrop does not add this element to the code.
Lastly, "demanding" changes should never be promoted in this community, if you would like to "suggest" a change to code, please submit a .patch.
-- back to the original issue, can anyone review the proposed change and mark RTBC? I cannot test this at the moment, but I will commit if marked RTBC. Also, I am assuming this code is valid for 6.x as well as 5.x; Please correct me if I am wrong.
Comment #6
sclathrop commentedWow - can of worms, anyone? Sorry. Two observations:
1. As indicated by brdwor, RecipeML itself is not HTML or XHTML (per se), but rather an XML DTD (Document Type Definition) that can be used to export (in this case), import and otherwise share information within a common standard. In no way would a declared XML data export violate the coding standards of XHTML 1.0 Strict, or the letter (or spirit) of Drupal's development standards.
2. Personally I have tired of re-typing, formating and manipulating my recipe collection for each new system, and the availability of the RecipeML export feature was one reason I liked and have started to use this module, but am finding it deficient (when compared to the RecipeML DTD) in a few ways. Upon completion of the additional revisions I am making I will submit a diff .patch file for peer-review.
Comment #7
jvandervort commentedCommitted some xml escaping to the 6.x-dev branch.