Code Formatting in a Reply

1498
11
Jump to solution
11-24-2020 12:07 PM
JoeBorgione
MVP Emeritus

In the new forum is it possible to use the code formatter when replying to a post?  I don't see the button in the tool bar for replies.

That should just about do it....
0 Kudos
2 Solutions

Accepted Solutions
by Anonymous User
Not applicable

Hi Joe, the text editor in replies looks slighty different from the original post version with the three dots at the end of line 1. 

If you click on Formats then you'll see all the other Rich Text Editor options including Insert code. 

InlineReplyTextEditor.JPGLet me know if you see this ok in your view and this works for what you're trying to do. 

View solution in original post

by Anonymous User
Not applicable

Hey everyone thanks for the patience on this issue. The text editor has now been updated by our support team to provide the full text editor experience whether you are composing a new message or replying to a post or editing a previous reply. Apologies this issue has impacted your work in the community and thanks for working with us on this. 

Inline Reply - Collapsed View
InlineEditorCollapsed.JPG

Inline Reply - Expanded View

InlineEditorExpanded.JPG

Let me know if you still see any other issues. 

View solution in original post

11 Replies
by Anonymous User
Not applicable

Hi Joe, the text editor in replies looks slighty different from the original post version with the three dots at the end of line 1. 

If you click on Formats then you'll see all the other Rich Text Editor options including Insert code. 

InlineReplyTextEditor.JPGLet me know if you see this ok in your view and this works for what you're trying to do. 

JoeBorgione
MVP Emeritus

Son of gun: there it is!  Looked at the Formats pull down but didn't go deep enough...

That should just about do it....
XanderBakker
Esri Esteemed Contributor

Hi @Anonymous User ,

 

Just a follow-up question... how do you define the code language (Python, JavaScript, etc...)? 

 

It may also be good to update the community help document since it is still referring to the "old" way: https://community.esri.com/t5/community-help-documents/how-to-insert-code-in-your-post/ta-p/914552 

by Anonymous User
Not applicable

Thanks Xander yes I noticed that in further testing too. I think we need to ensure we have the full text editor experience in replies that we have in new posts and this is what I've asked our support team to switch out for us. For now i'll update the known issues list with this Formats as a temporary workaround to include some simple HTML formatting but that the code insert is not the full version. I'd recommend using the Pre option under the Block rather than the Inline code one which created some funky errors when I tried it. 

JoeBorgione
MVP Emeritus

There is a bunch more testing to do: I just tried it and if I use the code format option that you mentioned earlier and try to post I get an html error and my reply does not post.  The code editor for replies does not seem to work as hope.

That should just about do it....
0 Kudos
DanPatterson
MVP Esteemed Contributor

"pre" works under Formats Blocks

def code_test():
"""Test"""
print("code test")
return

... sort of retired...
JoeBorgione
MVP Emeritus
import arcpy
fc = r'C:\some\file.gdb\someFeatureClass'
for field in arcpy.ListFields(fc):
print(f.name)
'''
it's kinda clunky; I tried to break out of this into another paragraph and haven't
figure that out just yet....
'''

 

That should just about do it....
DanPatterson
MVP Esteemed Contributor
def code_test():
"""Test"""
print("code test")
return

hit the arrow key

def code_test():
"""Test"""
print("code test")
return
got it?

... sort of retired...
JoeBorgione
MVP Emeritus

Lets see....

code goes here
and here...

Ahh, the old down arrow key trick!  Why didn't I think of that?!

That should just about do it....
0 Kudos