31 "<hr><table border=0>"
37 " <td><b>" +
_(
"Keywords" ) +
"</b></td>"
38 " <td>__KEYWORDS__</td>"
43 " <td><b>" +
_(
"Documentation" ) +
"</b></td>"
44 " <td><a href=\"__HREF__\">__TEXT__</a></td>"
55 size_t idx = desc.find( wxT(
"http:" ) );
57 if( idx == wxString::npos )
58 idx = desc.find( wxT(
"https:" ) );
60 if( idx == wxString::npos )
65 for(
auto chit = desc.begin() + idx; chit != desc.end(); ++chit )
70 if( ch <= 0x20 || ch >= 0x7F || ch ==
'"' )
76 else if( ch ==
')' && --nesting < 0 )
83 static wxString punct = wxS(
".,:;" );
85 if( punct.find( url.Last() ) != wxString::npos )
86 url = url.Left( url.Length() - 1 );
115 wxCHECK_RET(
m_fp_lib_table, wxT(
"Footprint library table pointer is not valid" ) );
127 wxLogError(
_(
"Error loading footprint %s from library '%s'." ) + wxS(
"\n%s" ),
147 esc_desc.Replace( wxS(
"\n" ), wxS(
"<br>" ) );
152 m_html.Replace(
"__DESC__", esc_desc );
156 keywordsHtml.Replace(
"__KEYWORDS__",
EscapeHTML( keywords ) );
159 docHtml.Replace(
"__HREF__",
EscapeHTML( doc ) );
161 if( doc.Length() > 75 )
162 doc = doc.Left( 72 ) + wxT(
"..." );
164 docHtml.Replace(
"__TEXT__",
EscapeHTML( doc ) );
166 m_html.Replace(
"__FIELDS__", keywordsHtml + docHtml );
const FOOTPRINT * GetEnumeratedFootprint(const wxString &aNickname, const wxString &aFootprintName)
A version of FootprintLoad() for use after FootprintEnumerate() for more efficient cache management.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
A logical library item identifier and consists of various portions much like a URI.
bool IsValid() const
Check if this LID_ID is valid.
const UTF8 & GetLibItemName() const
const UTF8 & GetLibNickname() const
Return the logical library name portion of a LIB_ID.
wxString EscapeHTML(const wxString &aString)
Return a new wxString escaped for embedding in HTML.
wxString UnescapeString(const wxString &aSource)
wxString LinkifyHTML(wxString aStr)
Wraps links in HTML tags.