Difference between revisions of "Template:Highlighter"

From Maths
Jump to: navigation, search
m (Using if statement to decide to display default, as an empty parameter still counts as it being set apparently)
m (Removing ''text'' as an alias for ''msg'' parameter)
Line 10: Line 10:
 
-->}}<!--
 
-->}}<!--
  
--><span style="">{{#if:{{{msg|{{{text|}}}}}}|{{{msg|{{{text|}}}}}}|{{{default|}}}}}</span><!--
+
--><span style="">{{#if:{{{msg|}}}|{{{msg|}}}|{{{default|}}}}}</span><!--
  
 
--></span><noinclude>
 
--></span><noinclude>
Line 23: Line 23:
 
! Comment
 
! Comment
 
|-
 
|-
! {{nowrap|{{C|msg}} / {{C|text}}}}
+
! {{C|msg}}
 
| ''(nothing)''
 
| ''(nothing)''
 
| the text to highlight  
 
| the text to highlight  
Line 30: Line 30:
 
! {{C|default}}
 
! {{C|default}}
 
| ''(nothing)''
 
| ''(nothing)''
| the text to highlight in the absence of {{C|msg}} or {{C|text}}
+
| the text to highlight in the absence of a {{C|msg}}
 
|-
 
|-
 
! {{C|bgcol}}
 
! {{C|bgcol}}

Revision as of 06:19, 13 December 2016

Todo:

TODO: There's a span tag with an empty style around the thing actually highlighted only (not the rest) - this could be used with border-bottom to achieve an underline-like effect, this is needed if the background is white say, so don't forget to mess with that

Parameters

Name Default Description Comment
msg (nothing) the text to highlight msg is dominant (if present text will be ignored)
default (nothing) the text to highlight in the absence of a msg
bgcol #FAFAFA background colour
markcol #DADADA background colour of left border or mark text if given
marktext (nothing) Use this if you want Caveat: or Note: to appear before the body of whatever is highlight, by default it is absent