Closed (fixed)
Project:
GeSHi Filter for syntax highlighting
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
25 Feb 2010 at 09:14 UTC
Updated:
29 Aug 2010 at 19:20 UTC
Jump to comment: Most recent file
Comments
Comment #1
abaddon commentedthis should be in geshi's issue queue, cck provides a hook for cck fields to provide diff data
ive attached a patch to fix this, patch is against the current HEAD
also, for geshinode, im not using it now but i suspect diff is already working (picking up changes in the _node body_)
Comment #2
soxofaan commentedIs there any documentation on this hook hook_content_diff_values?
I googled a bit, but didn't find a lot of info about it
(didn't try the patch yet)
Comment #3
abaddon commentednot sure, i got there by looking at some old cck archive i had which did things differently, and looking the the most recent stable version, and..
in cck/includes/content.diff.inc line 25:
see the changelog too
cck/CHANGELOG.txt:164:- Diff integration: refactored around a new hook_content_diff_values() to save contrib field modules the........
and theres some example implementations in that diff.inc, also filefield implements the "hook"
Comment #4
soxofaan commented(disclaimer: at the moment I don't have a development environment handy, so this is just from reading code)
In the patch of #1, you use the
t()function, while I didn't found this in any other implementation of hook_content_diff_values. Also, you put all the source code in one array item, whilenode_diff(from diff/node.inc) and content_content_diff_values (from cck/includes/content.diff.inc) explode the bodies on newlines.As a second iteration, I'd propose something like (again, I didn't test this code):
Comment #5
abaddon commentedStefaan, thank you for taking your time and looking at this
you are right about #2, lines should be exploded on newlines, i didnt payed attention to the fact that all my diffed content was highlighted because the actual differences were in red and it looked ok overall
#1 - the use of t(), i think its good coding practice, and harmless, to provide the user the ability to translate the label, without t() it wont be translatable, i dont think it has any side effects
ive tested your patch and it works fine, ive re-rolled it unmodified (just fixed a typo) and attached
Comment #6
soxofaan commentedThanks, committed:
http://drupal.org/cvs?commit=407678