Пример #1
0
 /** Used for nested block quotes. Removes '>' char. */
 public void removeBlockQuotePrefix() {
   Line line = this.lines;
   while (line != null) {
     if (!line.isEmpty) {
       if (line.value.charAt(line.leading) == '>') {
         int rem = line.leading + 1;
         if (line.leading + 1 < line.value.length()
             && line.value.charAt(line.leading + 1) == ' ') {
           rem++;
         }
         line.value = line.value.substring(rem);
         line.initLeading();
       }
     }
     line = line.next;
   }
 }
Пример #2
0
 /**
  * Used for nested lists. Removes list markers and up to 4 leading spaces.
  *
  * @param configuration txtmark configuration
  */
 public void removeListIndent(final Configuration configuration) {
   Line line = this.lines;
   while (line != null) {
     if (!line.isEmpty) {
       switch (line.getLineType(configuration)) {
         case ULIST:
           line.value = line.value.substring(line.leading + 2);
           break;
         case OLIST:
           line.value = line.value.substring(line.value.indexOf('.') + 2);
           break;
         default:
           line.value = line.value.substring(Math.min(line.leading, 4));
           break;
       }
       line.initLeading();
     }
     line = line.next;
   }
 }