1 module hunt.markdown.internal.Delimiter; 2 3 import hunt.markdown.node.Text; 4 import hunt.markdown.parser.delimiter.DelimiterRun; 5 6 /** 7 * Delimiter (emphasis, strong emphasis or custom emphasis). 8 */ 9 class Delimiter : DelimiterRun { 10 11 public Text node; 12 public char delimiterChar; 13 14 /** 15 * Can open emphasis, see spec. 16 */ 17 public bool _canOpen; 18 19 /** 20 * Can close emphasis, see spec. 21 */ 22 public bool _canClose; 23 24 public Delimiter previous; 25 public Delimiter next; 26 27 public int _length = 1; 28 public int _originalLength = 1; 29 30 public this(Text node, char delimiterChar, bool canOpen, bool canClose, Delimiter previous) { 31 this.node = node; 32 this.delimiterChar = delimiterChar; 33 this._canOpen = canOpen; 34 this._canClose = canClose; 35 this.previous = previous; 36 } 37 38 public bool canOpen() { 39 return _canOpen; 40 } 41 42 public bool canClose() { 43 return _canClose; 44 } 45 46 @property public int length() { 47 return _length; 48 } 49 50 public void setLength(int len) { 51 _length = len; 52 } 53 54 @property public int originalLength() { 55 return _originalLength; 56 } 57 58 public void setOriginalLength(int len) { 59 _originalLength = len; 60 } 61 }