Page MenuHomePhabricator

Pastes don't allow lua syntax highlighting
Closed, ResolvedPublic

Description

While in tasks, syntaxhighlighting is supported for lua uing lang=lua this option is not available when creating a paste. Pastes should also allow syntaxhighlighting for lua as it becomes more and more important to show examples of how lua can be used on Wikipedias.

Details

Related Gerrit Patches:

Event Timeline

Bene created this task.May 30 2015, 4:49 PM
Bene raised the priority of this task from to Needs Triage.
Bene updated the task description. (Show Details)
Bene added a project: Phabricator.
Bene added a subscriber: Bene.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMay 30 2015, 4:49 PM
Aklapper triaged this task as Lowest priority.May 31 2015, 1:12 PM
Aklapper edited projects, added Phabricator (Upstream); removed Phabricator.
Aklapper set Security to None.

This is configurable in pygments.dropdown-choices.

Naming a file something.lua and leaving "Language" set to "Detect Automatically" should also engage the Lua highlighter.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptMay 23 2016, 6:01 PM

Change 290409 had a related patch set uploaded (by Aklapper):
Add "Lua" to syntax highlighting dropdown choices in Phab's "Paste"

https://gerrit.wikimedia.org/r/290409

(Assuming as per previous comment that Lua is not wanted as a default choice in upstream, I've prepared a downstream configuration patch, for the lulz.)

Change 290409 merged by Dzahn:
Add "Lua" to syntax highlighting dropdown choices in Phab's "Paste"

https://gerrit.wikimedia.org/r/290409

Dzahn added a subscriber: Dzahn.May 25 2016, 6:27 PM

Lua is now an option in the dropdown

Here's a paste with Lua code and highlighting:

1 print("Hello World")
2
3
4 -- defines a factorial function
5 function fact (n)
6 if n == 0 then
7 return 1
8 else
9 return n * fact(n-1)
10 end
11 end
12
13 print("enter a number:")
14 a = io.read("*number") -- read a number
15 print(fact(a))
16

Dzahn closed this task as Resolved.May 25 2016, 6:28 PM
Dzahn claimed this task.
Dzahn removed a project: Patch-For-Review.