mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-01-03 13:10:33 -05:00
- Change incorrect "key sharing" references to "key forwarding". - Explain that this is a feature that needs to be enabled. - Regenerate the key forwarding algorithm diagram. - Provide a spec link and mention alternative names.
38 lines
782 B
Perl
Executable File
38 lines
782 B
Perl
Executable File
#!/usr/bin/perl
|
|
#
|
|
# Adapted from https://stackoverflow.com/a/68057031
|
|
|
|
use strict;
|
|
|
|
my $usage = "setdotlabelwidth [char-width] < [dotfile]";
|
|
my $width = shift() or die("Usage: $usage $!");
|
|
|
|
while(<STDIN>)
|
|
{
|
|
if (m/label="(.*?)"/)
|
|
{
|
|
my $labeltext = $1;
|
|
my @words = split(/ +|(?=\\n)/, $labeltext);
|
|
my @newtext = ();
|
|
my $newline = "";
|
|
foreach my $word(@words)
|
|
{
|
|
if (length($newline) > 0 and
|
|
length($newline) + length($word) > $width)
|
|
{
|
|
push(@newtext, $newline);
|
|
$newline = "";
|
|
}
|
|
|
|
$newline .= " " if (length($newline) > 0);
|
|
$newline .= $word;
|
|
}
|
|
|
|
push(@newtext, $newline) if (length($newline) > 0);
|
|
my $newlabel = join("\\n", @newtext);
|
|
s/label=".*?"/label="$newlabel"/;
|
|
}
|
|
|
|
print;
|
|
}
|