Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply marked in javascript #632

Closed
ghost opened this issue Jul 29, 2015 · 2 comments
Closed

Apply marked in javascript #632

ghost opened this issue Jul 29, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 29, 2015

I have a value attached to an ng-model. I would like this value to be run through marked. Something like this.

JS:
var text = "<script>alert('hello scriptio')</script>";
scope.text = marked(text)

HTML:
<textarea ng-model="text"></textarea>

Is this possible?

@robrothedev
Copy link

I'm not sure how the marked function works in the controller, but I'm binding content to my textarea and a div with a marked attribute without any issues:

function MarkdownEditorCtrl() {
  var vm = this;
  vm.markdown = '###Hello';
}
<div ng-controller="MarkdownEditorCtrl as ctrl">

  <!-- markdown editor -->
  <textarea ng-model="ctrl.markdown"></textarea>

  <!-- output of markdown -->
  <div marked="ctrl.markdown"></div>

</div>

@joshbruce
Copy link
Member

Closing as beyond scope at present. See #1106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants