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

ability to pull out RAW values. #68

Open
anlek opened this issue Aug 16, 2018 · 6 comments
Open

ability to pull out RAW values. #68

anlek opened this issue Aug 16, 2018 · 6 comments

Comments

@anlek
Copy link

anlek commented Aug 16, 2018

I have a situation where I want to be about to have text input that looks like this:

I believe @andrew likes cars more then toys, while @jill33 wants toys over cars.

but I want the raw output to look something like this:

[
  'I believe ', 
  {id: 1, firstName: 'Andrew', username: 'andrew' }, 
  ' likes cars more then toys, whille ', 
  {id: 3, firstName: 'Jill', username: 'jill33'}, 
  ' wants toys over cars.'
]

This way, I can submit the raw output to a database and can always re-render the users based on their ID. This way if Andrew renames himself to Draw, I can make this changes to the old content.

Thoughts on that posibility?

@fritx
Copy link
Owner

fritx commented Aug 19, 2018

@anlek vue-at doesn't do that thing for us 😆 - it's just a decorator/helper on textareas.
it'd be better we have our own functions to transform before/after the text-rendering, as you said above?

@anlek
Copy link
Author

anlek commented Aug 21, 2018

Hello @fritx,
I agree the rendering should be done outside the vue-at but the text array generated could be done with vue-at as it is based on the text entered via the helper.

@fritx
Copy link
Owner

fritx commented Aug 22, 2018

There is no "text array", vue-at just helps us type and @people in the editor
If I'm missing anything xD
I'm a bit long away from the library, my bad

@anlek
Copy link
Author

anlek commented Aug 22, 2018

No worries, I thought I'd ask just to see if it was possible. Right now I'm parsing the HTML content form the contentedtiable area in the backend into the array format mentioned above. It would be lovely if the Vue-at could do that for me in the feature.

@mankowitz
Copy link

as long as the text following the @ sign is unique, the way you're doing it sounds optimal. Another solution is to have a post-processing command that maintains a shadow input field. I made a pull request for a processItem function a few months ago, and that might be a good place to insert the json that you are talking about.

@fritx
Copy link
Owner

fritx commented Sep 6, 2018

Did you mean PR #47 ?
I would try to have a look again and merge it soon. @mankowitz


There are still problems in that PR, and also I can't get the point relative to this issue 😓

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

No branches or pull requests

3 participants