StylePtr links

In most cases, when you paste a blade style, it will now automatically link to the style editor, like this:

StylePtr<InOutHelper<SimpleClash<Lockup<Blast<OnSpark<Sparkle<Gradient<Blue,Cyan,Green,GreenYellow,Yellow,Orange,Red>,FloralWhite,100,700>,Cyan,1200>,White,200,100,400>,AudioFlicker<Blue,White>,AudioFlicker<Blue,White>>,White,40>,200,400,Black>>()

Please let me know if it’s causing any problems.

test
EDIT the following (spaced to avoid the issue)
StylePtr < Black > ( )
is coming out like this:

StylePtr()

and it’s not a link to editor.

test 2

StylePtr<Layers<AudioFlicker<BrownNoiseFlicker<Mix<SwingSpeed<400>,RotateColorsX<Variation,Rgb<100,100,150>>,RotateColorsX<Variation,Rgb<150,150,225>>>,Stripes<5000,-300,RotateColorsX<Variation,Rgb<25,25,55>>,RotateColorsX<Variation,Rgb<75,75,120>>,RotateColorsX<Variation,Rgb<10,10,20>>,RotateColorsX<Variation,Rgb<50,50,75>>>,300>,RotateColorsX<Variation,Rgb<35,35,75>>>,LockupTrL<Layers<AlphaL<AudioFlickerL< White >,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>>,Scale<SwingSpeed<100>,Int<14000>,Int<18000>>>>,AlphaL<White,Bump<Scale<BladeAngle<>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>>,Int<10000>>>>,TrConcat<TrInstant,White,TrFade<400>>,TrConcat<TrInstant,White,TrFade<400>>,SaberBase::LOCKUP_NORMAL>,ResponsiveLightningBlockL<Strobe<White,AudioFlicker<White,Blue>,50,1>,TrConcat<TrInstant,AlphaL<White,Bump<Int<12000>,Int<18000>>>,TrFade<200>>,TrConcat<TrInstant,HumpFlickerL<AlphaL<White,Int<16000>>,30>,TrSmoothFade<600>>>,ResponsiveStabL<Red,TrWipeIn<600>,TrWipe<600>>,ResponsiveBlastL<White,Int<400>,Scale<SwingSpeed<200>,Int<100>,Int<400>>,Int<400>>,ResponsiveClashL<White,TrInstant,TrFade<400>,Scale<BladeAngle<0,16000>,Int<4000>,Int<26000>>,Int<6000>,Int<20000>>,LockupTrL<AlphaL<BrownNoiseFlickerL<White,Int<300>>,SmoothStep<Int<30000>,Int<5000>>>,TrWipeIn<400>,TrFade<300>,SaberBase::LOCKUP_DRAG>,LockupTrL<AlphaL<Mix<TwistAngle<>,Red,Orange>,SmoothStep<Int<28000>,Int<5000>>>,TrWipeIn<600>,TrFade<300>,SaberBase::LOCKUP_MELT>,InOutTrL<TrWipe<1400>,TrWipeInSparkTip<White,500>,Black>,TransitionEffectL<TrConcat<TrInstant,AlphaL<BrownNoiseFlickerL<White,Int<30>>,SmoothStep<Scale<SlowNoise<Int<2000>>,Int<1000>,Int<4000>>,Int<-4000>>>,TrDelay<2000>>,EFFECT_RETRACTION>,TransitionEffectL<TrConcat<TrWipe<1000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrDelay<2000>,AlphaL<Mix<BatteryLevel,Red,Green>,SmoothStep<BatteryLevel,Int<-10>>>,TrWipeIn<1000>>,EFFECT_BATTERY_LEVEL>>>()

It looks like StylePtr < Black > () doesn’t come out right even without my new hack. (Because it looks like HTML)
The only way I can seem to make it work properly is to use the triple-backtick, but that also disables the auto-linking.

Indeed.
< white > also does it.
The style I posted above does link to the editor, where it complains about AudioFlickerL because it’s color is missing.
It works if spaces are added :man_shrugging:

Test: StylePtr()

The way it interprets HTML makes it difficult to post styles properly.
[ pre ] and triple-backquote works fine, but I’m not sure I can get auto-linking to work there.
Looks like I’m going to have to dig deeper.

It’s a cool feature.

I may have found a way to make this work better.
However, I’m going to have to do a little maintenence, so if the cruicible goes down for a little bit it’s just me messing with it.

Ok, so messing with discourse is slow and difficult.
I tried introducing a small change by changing the github repository to my fork, but it just didn’t want to work. It also didn’t tell me why, and each attempt takes like 5 minutes… Which is why the crucible has been down for a few hours today.

I added a theme component that throws up a warning if you try to post style templates without using backticks. This will solve the disappearing tag problem, but I will need to write a better auto-linkify theme component as the current one doesn’t work on pre-formatted code.

Hmm, it does seem to kind of work on pre-formatted code.
At least if that pre-formatted code is posted as a single line…

Ok, I think multi-line styles work properly now:

StylePtr<Layers<
  Layers<
    Gradient<Blue,Cyan,Green,GreenYellow,Yellow,Orange,Red>,
    SparkleL<FloralWhite,100,700>,
    OnSparkL<Cyan,Int<1200>>>,
  BlastL<White>,
  LockupL<AudioFlicker<Blue,White>>,
  SimpleClashL<White>,
  InOutHelperL<InOutFuncX<Int<200>,Int<400>>>>>()

test

StylePtr<Layers<
  Red,
  ResponsiveLockupL<White,TrInstant,TrInstant,Int<26000>>,
  ResponsiveLightningBlockL<White>,
  ResponsiveMeltL<Mix<TwistAngle<>,Red,Yellow>>,
  ResponsiveDragL<White>,
  ResponsiveClashL<White,TrInstant,TrFade<200>,Int<26000>>,
  ResponsiveBlastL<White>,
  ResponsiveBlastWaveL<White>,
  ResponsiveBlastFadeL<White>,
  ResponsiveStabL<White>,
  InOutTrL<TrWipe<300>,TrWipeIn<500>>>>()

StylePtr<Black>()

Sweet! Thanks @profezzorn