Blanks in middle of the code line #4891
-
We want to achieve blanks in the middle of the code with syntax highlighting. Like below image We explored but we didn't get any approaches. To achieve this we used multiple code editors. For example, from the above image, we used a code editor from 1 to 11 lines, an HTML element in the 12th line, and another code editor from the 13th line. As we won't be getting syntax highlighting for the 12th line, we have separately rendered a code editor having the 12th line contents as code. This code editor won't be visible to the user, and is solely rendered for getting syntax highlighting.
Now, we are copying the elements (with classnames) that got rendered inside the code editor, and replacing the id1 and id2 in the above expression with our Blanks (Input tags basically). Is this method safe? Is there any other short way or the best way to achieve this kind of use case? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The right method to implement this depends on the way you want the rest of the editor to behave, what other parts should be editable, should user be able to select all the code, etc. Could you tell more about your usecase? |
Beta Was this translation helpful? Give feedback.
-
We want to apply syntax highlighting in blanks which we have created in the middle of codes using input tag. So in the above image we have kept input tags between static highlightings, from 0th character to '> ' symbol we have one static highlighting then we have an input tag(with my own styles) then another static highlighting (did in the same manner as the above developer @krishnagogada) . So we want to apply syntax highlighting in that input tag. Is there any way of creating blank in between codes with syntax highlighting? |
Beta Was this translation helpful? Give feedback.
The right method to implement this depends on the way you want the rest of the editor to behave, what other parts should be editable, should user be able to select all the code, etc. Could you tell more about your usecase?