dimpu / ngx-md

Angular(ngx) directive for parsing markdown content in your web application.
https://dimpu.github.io/ngx-md/
264 stars 80 forks source link

i want a Markdown string after i edit my table generated by angular2-markdown #60

Closed yvankhekhone closed 7 years ago

yvankhekhone commented 7 years ago

well i need some help i don t understand doc where a i can find a a new string markedown after editing a generated table by angular2- mardown.

midzer commented 7 years ago

To be honest i don't understand what you are trying to ask. Please try an online translator.

yvankhekhone commented 7 years ago
well thank you answer me :) i think i have to put an example i have in entry this markdown string. ' 1 2 2
4 5 6 ;

and i want this


1 2 3
4 5 6

where i have to change this code but i dont know how to override method and where . in construtor or in your service .

marked.renderer.tablecell= function(content, flags, i ) { var type = flags.header ? 'th' : 'td'; var tag = flags.align ? '<' + type + 'id="type"'+i+ 'style="text-align:' + flags.align + '">' : '<' + type + '>'; return tag + content + '</' + type + '>\n'; };

marked.Parser.tok=function() { switch (this.token.type) { case 'space': { return ''; } case 'hr': { return this.renderer.hr(); } case 'heading': { return this.renderer.heading( this.inline.output(this.token.text), this.token.depth, this.token.text); } case 'code': { return this.renderer.code(this.token.text, this.token.lang, this.token.escaped); } case 'table': { var header = '' , body = '' , i , row , cell , flags , j;

  // header
  cell = '';
  for (i = 0; i < this.token.header.length; i++) {
    flags = { header: true, align: this.token.align[i] };
    cell += this.renderer.tablecell(
      this.inline.output(this.token.header[i]),
      { header: true, align: this.token.align[i] }
    ,i);
  }
  header += this.renderer.tablerow(cell);

  for (i = 0; i < this.token.cells.length; i++) {
    row = this.token.cells[i];

    cell = '';
    for (j = 0; j < row.length; j++) {
      cell += this.renderer.tablecell(
        this.inline.output(row[j]),
        { header: false, align: this.token.align[j] }
      ,j);
    }

    body += this.renderer.tablerow(cell);
  }
  return this.renderer.table(header, body);
}
case 'blockquote_start': {
  var body = '';

  while (this.next().type !== 'blockquote_end') {
    body += this.tok();
  }

  return this.renderer.blockquote(body);
}
case 'list_start': {
  var body = ''
    , ordered = this.token.ordered;

  while (this.next().type !== 'list_end') {
    body += this.tok();
  }

  return this.renderer.list(body, ordered);
}
case 'list_item_start': {
  var body = '';

  while (this.next().type !== 'list_item_end') {
    body += this.token.type === 'text'
      ? this.parseText()
      : this.tok();
  }

  return this.renderer.listitem(body);
}
case 'loose_item_start': {
  var body = '';

  while (this.next().type !== 'list_item_end') {
    body += this.tok();
  }

  return this.renderer.listitem(body);
}
case 'html': {
  var html = !this.token.pre && !this.options.pedantic
    ? this.inline.output(this.token.text)
    : this.token.text;
  return this.renderer.html(html);
}
case 'paragraph': {
  return this.renderer.paragraph(this.inline.output(this.token.text));
}
case 'text': {
  return this.renderer.paragraph(this.parseText());
}

}

2017-05-22 17:17 GMT+02:00 midzer notifications@github.com:

To be honest i don't understand what you are trying to ask. Please try an online translator.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/dimpu/angular2-markdown/issues/60#issuecomment-303131205, or mute the thread https://github.com/notifications/unsubscribe-auth/Abhgg1DHTAuO4iatKCOhG3TpRKNQsB76ks5r8ackgaJpZM4NiJYZ .